explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 5k5x

Settings
# exclusive inclusive rows x rows loops node
1. 0.005 2,232.136 ↑ 1.0 25 1

Limit (cost=138,948.45..161,690.67 rows=25 width=156) (actual time=2,231.896..2,232.136 rows=25 loops=1)

2. 0.032 2,232.131 ↑ 1,109.7 25 1

Merge Left Join (cost=138,948.45..25,375,535.22 rows=27,742 width=156) (actual time=2,231.895..2,232.131 rows=25 loops=1)

  • Merge Cond: (br.billingrunid = q2.billingrunid)
3. 0.024 14.462 ↑ 1,109.7 25 1

Merge Left Join (cost=2,627.84..5,113.93 rows=27,742 width=124) (actual time=14.428..14.462 rows=25 loops=1)

  • Merge Cond: (br.billingrunid = idr.billingrunid)
4. 0.033 0.033 ↑ 1,109.7 25 1

Index Scan Backward using billingrun_pkey on billingrun br (cost=0.29..2,007.53 rows=27,742 width=116) (actual time=0.018..0.033 rows=25 loops=1)

5. 7.714 14.405 ↑ 5,460.0 5 1

Sort (cost=2,627.55..2,695.80 rows=27,300 width=12) (actual time=14.405..14.405 rows=5 loops=1)

  • Sort Key: idr.billingrunid
  • Sort Method: quicksort Memory: 2048kB
6. 6.691 6.691 ↑ 1.0 27,300 1

Seq Scan on invdocrun idr (cost=0.00..616.00 rows=27,300 width=12) (actual time=0.008..6.691 rows=27,300 loops=1)

7. 4.385 2,217.437 ↑ 11.1 18 1

Sort (cost=136,320.62..136,321.12 rows=200 width=36) (actual time=2,217.435..2,217.437 rows=18 loops=1)

  • Sort Key: q2.billingrunid
  • Sort Method: quicksort Memory: 1151kB
8. 1.824 2,213.052 ↓ 74.8 14,957 1

Subquery Scan on q2 (cost=136,307.48..136,312.98 rows=200 width=36) (actual time=2,202.330..2,213.052 rows=14,957 loops=1)

9. 30.195 2,211.228 ↓ 74.8 14,957 1

HashAggregate (cost=136,307.48..136,310.98 rows=200 width=22) (actual time=2,202.329..2,211.228 rows=14,957 loops=1)

  • Group Key: bm.billingrunid
10. 584.631 2,181.033 ↑ 15.3 17,719 1

HashAggregate (cost=126,819.36..129,530.25 rows=271,089 width=14) (actual time=2,175.641..2,181.033 rows=17,719 loops=1)

  • Group Key: bm.billingrunid, pv.internalparametervaluecode
11. 754.644 1,596.402 ↓ 1.0 2,369,212 1

Hash Join (cost=79.34..109,055.88 rows=2,368,464 width=14) (actual time=0.741..1,596.402 rows=2,369,212 loops=1)

  • Hash Cond: ((bm.billingmessagetypeid)::text = (bmt.billingmessagetypeid)::text)
12. 841.082 841.082 ↓ 1.0 2,369,212 1

Seq Scan on billingmessage bm (cost=0.00..76,410.16 rows=2,368,464 width=27) (actual time=0.057..841.082 rows=2,369,212 loops=1)

  • Filter: ((billingphase)::text = 'billing'::text)
  • Rows Removed by Filter: 53521
13. 0.102 0.676 ↓ 1.0 321 1

Hash (cost=75.34..75.34 rows=320 width=53) (actual time=0.676..0.676 rows=321 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 26kB
14. 0.142 0.574 ↓ 1.0 321 1

Hash Join (cost=53.74..75.34 rows=320 width=53) (actual time=0.397..0.574 rows=321 loops=1)

  • Hash Cond: (bmt.billingmessageseverityparamid = pv.parametervalueid)
15. 0.045 0.045 ↓ 1.0 321 1

Seq Scan on billingmessagetype bmt (cost=0.00..17.20 rows=320 width=47) (actual time=0.003..0.045 rows=321 loops=1)

16. 0.133 0.387 ↑ 1.2 878 1

Hash (cost=40.55..40.55 rows=1,055 width=14) (actual time=0.387..0.387 rows=878 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 36kB
17. 0.254 0.254 ↑ 1.2 878 1

Seq Scan on parametervalue pv (cost=0.00..40.55 rows=1,055 width=14) (actual time=0.003..0.254 rows=878 loops=1)

18.          

SubPlan (for Merge Left Join)

19. 0.000 0.025 ↓ 0.0 0 25

Limit (cost=0.43..1.62 rows=1 width=4) (actual time=0.001..0.001 rows=0 loops=25)

20. 0.025 0.025 ↓ 0.0 0 25

Index Scan using invdoc_invdocrunid on invdoc id (cost=0.43..1,537.98 rows=1,288 width=4) (actual time=0.001..0.001 rows=0 loops=25)

  • Index Cond: (invdocrunid = idr.invdocrunid)
21. 0.025 0.175 ↑ 1.0 1 25

Aggregate (cost=907.96..907.97 rows=1 width=0) (actual time=0.007..0.007 rows=1 loops=25)

22. 0.150 0.150 ↑ 289.0 5 25

Index Only Scan using invoice_billingrunid_index on invoice (cost=0.43..904.35 rows=1,445 width=0) (actual time=0.003..0.006 rows=5 loops=25)

  • Index Cond: (billingrunid = br.billingrunid)
  • Heap Fetches: 134
Planning time : 2.009 ms
Execution time : 2,236.270 ms