explain.depesz.com

PostgreSQL's explain analyze made readable

Result: FYKF

Settings
# exclusive inclusive rows x rows loops node
1. 11.314 3,599.276 ↑ 1.0 1 1

Aggregate (cost=3,492.26..3,492.29 rows=1 width=16) (actual time=3,599.276..3,599.276 rows=1 loops=1)

2. 0.000 3,587.962 ↓ 349.1 67,718 1

Nested Loop Left Join (cost=14.68..3,490.80 rows=194 width=8) (actual time=13.813..3,587.962 rows=67,718 loops=1)

3. 26.477 3,386.286 ↓ 349.1 67,718 1

Nested Loop (cost=12.35..3,025.69 rows=194 width=12) (actual time=13.745..3,386.286 rows=67,718 loops=1)

4. 18.281 192.161 ↓ 371.1 71,992 1

Hash Join (cost=1.83..966.38 rows=194 width=16) (actual time=0.124..192.161 rows=71,992 loops=1)

  • Hash Cond: (gh.gl_book_id = gb.id)
5. 173.861 173.861 ↓ 186.0 71,992 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.088..173.861 rows=71,992 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.006 0.019 ↑ 1.0 4 1

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

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

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

  • Filter: (cid = 2603)
  • Rows Removed by Filter: 4
8. 287.968 3,167.648 ↑ 1.0 1 71,992

Aggregate (cost=10.52..10.55 rows=1 width=97) (actual time=0.044..0.044 rows=1 loops=71,992)

  • 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.154 2,879.680 ↓ 13.0 13 71,992

Nested Loop (cost=2.62..10.52 rows=1 width=5) (actual time=0.009..0.040 rows=13 loops=71,992)

10. 202.534 1,295.856 ↓ 13.0 13 71,992

Hash Semi Join (cost=2.35..9.20 rows=1 width=17) (actual time=0.007..0.018 rows=13 loops=71,992)

  • Hash Cond: (gd.property_id = lp.property_id)
11. 1,079.880 1,079.880 ↓ 3.8 15 71,992

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.006..0.015 rows=15 loops=71,992)

  • Index Cond: (gh.id = gl_header_id)
  • Filter: ((cid = 2603) AND (gl_transaction_type_id = gh.gl_transaction_type_id))
12. 0.109 13.442 ↓ 464.0 464 1

Hash (cost=1.88..1.88 rows=1 width=8) (actual time=13.442..13.442 rows=464 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 27kB
13. 13.333 13.333 ↓ 464.0 464 1

Function Scan on load_properties lp (cost=0.25..1.88 rows=1 width=8) (actual time=13.245..13.333 rows=464 loops=1)

  • Filter: (cid = 2603)
14. 970.670 970.670 ↑ 1.0 1 970,670

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

  • Index Cond: ((cid = 2603) AND (id = gd.property_id) AND (is_disabled = 0))
  • Heap Fetches: 171882
15. 67.718 203.154 ↓ 0.0 0 67,718

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

16. 67.718 135.436 ↓ 0.0 0 67,718

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

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

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,718)

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