explain.depesz.com

PostgreSQL's explain analyze made readable

Result: tEZ7

Settings
# exclusive inclusive rows x rows loops node
1. 9.058 126.131 ↓ 24.6 3,736 1

GroupAggregate (cost=936.88..949.80 rows=152 width=149) (actual time=116.184..126.131 rows=3,736 loops=1)

  • Group Key: gd.cid, gd.property_id, gd.accrual_gl_account_id, gd.period_id, gh.gl_book_id, (COALESCE(gd.property_building_id, 0)), (COALESCE(gd.property_unit_id, 0)), (COALESCE(gd.gl_dimension_id, 0)), (COALESCE(gd.company_department_id, 0)), gd.post_month, gh.post_date, ((gh.gl_header_status_type_id = 2))
2. 12.260 117.073 ↓ 71.9 10,925 1

Sort (cost=936.88..937.26 rows=152 width=50) (actual time=116.166..117.073 rows=10,925 loops=1)

  • Sort Key: gd.accrual_gl_account_id, gd.period_id, gh.gl_book_id, (COALESCE(gd.property_building_id, 0)), (COALESCE(gd.property_unit_id, 0)), (COALESCE(gd.gl_dimension_id, 0)), (COALESCE(gd.company_department_id, 0)), gd.post_month, gh.post_date, ((gh.gl_header_status_type_id = 2))
  • Sort Method: quicksort Memory: 1,920kB
3. 10.886 104.813 ↓ 71.9 10,925 1

Nested Loop (cost=1.00..931.37 rows=152 width=50) (actual time=0.777..104.813 rows=10,925 loops=1)

4. 61.152 61.152 ↓ 40.5 10,925 1

Index Scan using idx_gl_details_cid_property_id_post_month_accrual_gl_account_id on gl_details gd (cost=0.56..262.73 rows=270 width=45) (actual time=0.735..61.152 rows=10,925 loops=1)

  • Index Cond: ((cid = 13,576) AND (property_id = 679,024) AND (post_month > '11/01/2019'::date) AND (accrual_gl_account_id IS NOT NULL))
5. 32.775 32.775 ↑ 1.0 1 10,925

Index Scan using idx_gl_headers_id on gl_headers gh (cost=0.43..2.48 rows=1 width=20) (actual time=0.003..0.003 rows=1 loops=10,925)

  • Index Cond: (id = gd.gl_header_id)
  • Filter: ((is_template IS FALSE) AND (cid = 13,576) AND (gl_header_status_type_id = ANY ('{1,2,3}'::integer[])))
Planning time : 3.469 ms
Execution time : 126.468 ms