explain.depesz.com

PostgreSQL's explain analyze made readable

Result: ZcME

Settings
# exclusive inclusive rows x rows loops node
1. 28.557 582.875 ↓ 183.0 183 1

GroupAggregate (cost=42.68..42.71 rows=1 width=44) (actual time=546.783..582.875 rows=183 loops=1)

  • Group Key: gd.cid, gd.property_id, gat.gl_account_id
2. 44.961 554.318 ↓ 158,165.0 158,165 1

Sort (cost=42.68..42.68 rows=1 width=25) (actual time=546.770..554.318 rows=158,165 loops=1)

  • Sort Key: gat.gl_account_id
  • Sort Method: quicksort Memory: 18501kB
3. 66.643 509.357 ↓ 158,165.0 158,165 1

Nested Loop (cost=2.71..42.67 rows=1 width=25) (actual time=0.155..509.357 rows=158,165 loops=1)

4. 18.501 126.384 ↓ 158,165.0 158,165 1

Nested Loop (cost=2.27..40.20 rows=1 width=29) (actual time=0.145..126.384 rows=158,165 loops=1)

5. 0.648 2.050 ↓ 1,163.0 1,163 1

Nested Loop (cost=1.71..22.82 rows=1 width=12) (actual time=0.060..2.050 rows=1,163 loops=1)

6. 0.198 0.239 ↓ 193.8 1,163 1

Bitmap Heap Scan on gat_temp gat (cost=1.42..7.75 rows=6 width=12) (actual time=0.049..0.239 rows=1,163 loops=1)

  • Recheck Cond: (cid = 224)
  • Heap Blocks: exact=18
7. 0.041 0.041 ↓ 193.8 1,163 1

Bitmap Index Scan on idx_temp_cid (cost=0.00..1.42 rows=6 width=0) (actual time=0.041..0.041 rows=1,163 loops=1)

  • Index Cond: (cid = 224)
8. 1.163 1.163 ↑ 1.0 1 1,163

Index Scan using idx_gl_branches_id on gl_branches gb (cost=0.29..2.51 rows=1 width=12) (actual time=0.001..0.001 rows=1 loops=1,163)

  • Index Cond: (id = gat.gl_branch_id)
  • Filter: (cid = 224)
9. 105.833 105.833 ↓ 12.4 136 1,163

Index Scan using idx_gl_details_cid_property_id_accrual_gl_account_id on gl_details gd (cost=0.56..17.27 rows=11 width=25) (actual time=0.002..0.091 rows=136 loops=1,163)

  • Index Cond: ((cid = 224) AND (property_id = 2458) AND (accrual_gl_account_id = gat.gl_account_id))
  • Filter: (post_month < '2019-01-01'::date)
  • Rows Removed by Filter: 15
10. 316.330 316.330 ↑ 1.0 1 158,165

Index Scan using idx_gl_headers_id on gl_headers gh (cost=0.43..2.46 rows=1 width=12) (actual time=0.002..0.002 rows=1 loops=158,165)

  • Index Cond: (id = gd.gl_header_id)
  • Filter: ((NOT is_template) AND (cid = 224) AND (gl_book_id = 132) AND (gl_header_status_type_id <> ALL ('{2,4,5,6}'::integer[])) AND ((gd.post_month < '2019-08-01'::date) OR ((gd.post_month = '2019-08-01'::date) AND (post_date <= '2019-09-03'::date))))
  • Rows Removed by Filter: 0
Planning time : 2.456 ms