explain.depesz.com

PostgreSQL's explain analyze made readable

Result: wpdH

Settings
# exclusive inclusive rows x rows loops node
1. 11.737 3,196.538 ↑ 1.0 1 1

Aggregate (cost=9,610.83..9,610.86 rows=1 width=16) (actual time=3,196.538..3,196.538 rows=1 loops=1)

2. 0.000 3,184.801 ↓ 349.1 67,722 1

Nested Loop Left Join (cost=46.22..9,609.37 rows=194 width=8) (actual time=0.405..3,184.801 rows=67,722 loops=1)

3. 0.000 2,993.759 ↓ 349.1 67,722 1

Nested Loop (cost=43.89..9,144.26 rows=194 width=12) (actual time=0.369..2,993.759 rows=67,722 loops=1)

4. 18.145 116.646 ↓ 371.1 71,996 1

Hash Join (cost=1.83..966.38 rows=194 width=16) (actual time=0.063..116.646 rows=71,996 loops=1)

  • Hash Cond: (gh.gl_book_id = gb.id)
5. 98.478 98.478 ↓ 186.0 71,996 1

Index Scan using idx_gl_headers_cid_gl_transaction_type_id_post_month_reference_ on gl_headers gh (cost=0.43..962.48 rows=387 width=20) (actual time=0.033..98.478 rows=71,996 loops=1)

  • Index Cond: ((cid = 2603) AND (gl_transaction_type_id = 1) AND (reference_id IS NULL))
  • Filter: ((is_template IS FALSE) AND (gl_header_status_type_id = ANY ('{5,2,1,3}'::integer[])))
  • Rows Removed by Filter: 2811
6. 0.015 0.023 ↑ 1.0 4 1

Hash (cost=1.26..1.26 rows=4 width=8) (actual time=0.023..0.023 rows=4 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
7. 0.008 0.008 ↑ 1.0 4 1

Seq Scan on gl_books gb (cost=0.00..1.26 rows=4 width=8) (actual time=0.006..0.008 rows=4 loops=1)

  • Filter: (cid = 2603)
  • Rows Removed by Filter: 4
8. 287.984 2,879.840 ↑ 1.0 1 71,996

Aggregate (cost=42.06..42.09 rows=1 width=97) (actual time=0.039..0.040 rows=1 loops=71,996)

  • Filter: (sum(CASE WHEN (gd.amount > '0'::numeric) THEN gd.amount ELSE '0'::numeric END) IS NOT NULL)
  • Rows Removed by Filter: 0
9. 613.224 2,591.856 ↓ 3.2 13 71,996

Nested Loop (cost=33.87..42.04 rows=4 width=5) (actual time=0.007..0.036 rows=13 loops=71,996)

  • Join Filter: (gd.property_id = p.id)
10. 215.796 1,007.944 ↓ 3.2 13 71,996

Hash Semi Join (cost=33.60..40.57 rows=4 width=17) (actual time=0.005..0.014 rows=13 loops=71,996)

  • Hash Cond: (gd.property_id = lp.property_id)
11. 791.956 791.956 ↓ 3.8 15 71,996

Index Scan using idx_gl_details_gl_header_id on gl_details gd (cost=0.44..7.28 rows=4 width=13) (actual time=0.004..0.011 rows=15 loops=71,996)

  • Index Cond: (gh.id = gl_header_id)
  • Filter: ((cid = 2603) AND (gl_transaction_type_id = gh.gl_transaction_type_id))
12. 0.093 0.192 ↑ 1.0 464 1

Hash (cost=18.08..18.08 rows=464 width=8) (actual time=0.192..0.192 rows=464 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 27kB
13. 0.099 0.099 ↑ 1.0 464 1

Seq Scan on lp (cost=0.00..18.08 rows=464 width=8) (actual time=0.013..0.099 rows=464 loops=1)

  • Filter: (cid = 2603)
14. 970.688 970.688 ↑ 1.0 1 970,688

Index Only Scan using idx_properties_cid_id_is_disabled_remote_primary_key on properties p (cost=0.28..0.33 rows=1 width=8) (actual time=0.001..0.001 rows=1 loops=970,688)

  • Index Cond: ((cid = 2603) AND (id = lp.property_id) AND (is_disabled = 0))
  • Heap Fetches: 171886
15. 67.722 203.166 ↓ 0.0 0 67,722

Limit (cost=2.33..2.34 rows=1 width=8) (actual time=0.003..0.003 rows=0 loops=67,722)

16. 67.722 135.444 ↓ 0.0 0 67,722

Sort (cost=2.33..2.34 rows=1 width=8) (actual time=0.002..0.002 rows=0 loops=67,722)

  • Sort Key: fa.id DESC
  • Sort Method: quicksort Memory: 25kB
17. 67.722 67.722 ↓ 0.0 0 67,722

Index Scan using idx_file_associations_gl_header_id_partial on file_associations fa (cost=0.28..2.32 rows=1 width=8) (actual time=0.001..0.001 rows=0 loops=67,722)

  • Index Cond: ((gh.cid = cid) AND (gh.id = gl_header_id))
  • Filter: (deleted_by IS NULL)
Planning time : 4.274 ms
Execution time : 3,196.700 ms