explain.depesz.com

PostgreSQL's explain analyze made readable

Result: gkFG

Settings
# exclusive inclusive rows x rows loops node
1. 439.951 614.401 ↓ 0.0 0 1

Insert on cached_gl_account_days (cost=71,734.36..72,568.86 rows=12,363 width=229) (actual time=614.401..614.401 rows=0 loops=1)

  • Conflict Resolution: UPDATE
  • Conflict Arbiter Indexes: uk_cached_gl_account_days_all_ids_post_month_post_date
  • Tuples Inserted: 0
  • Conflicting Tuples: 15033
2. 12.147 174.450 ↓ 1.2 15,033 1

Subquery Scan on "*SELECT*" (cost=71,734.36..72,568.86 rows=12,363 width=229) (actual time=144.352..174.450 rows=15,033 loops=1)

3. 56.648 162.303 ↓ 1.2 15,033 1

HashAggregate (cost=71,734.36..71,981.62 rows=12,363 width=149) (actual time=144.243..162.303 rows=15,033 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)
4. 5.167 105.655 ↓ 3.4 41,730 1

Nested Loop (cost=1.00..71,208.93 rows=12,363 width=50) (actual time=0.098..105.655 rows=41,730 loops=1)

5. 17.028 17.028 ↓ 2.0 41,730 1

Index Scan using idx_gl_details_cid_property_id_post_month_accrual_gl_account_id on gl_details gd (cost=0.56..21,566.04 rows=21,261 width=45) (actual time=0.063..17.028 rows=41,730 loops=1)

  • Index Cond: ((cid = 13576) AND (property_id = 347830) AND (post_month > '2019-11-01'::date) AND (post_month <= '2020-01-10'::date) AND (accrual_gl_account_id IS NOT NULL))
6. 83.460 83.460 ↑ 1.0 1 41,730

Index Scan using idx_gl_headers_id on gl_headers gh (cost=0.43..2.33 rows=1 width=20) (actual time=0.002..0.002 rows=1 loops=41,730)

  • Index Cond: (id = gd.gl_header_id)
  • Filter: ((is_template IS FALSE) AND (cid = 13576) AND (gl_header_status_type_id = ANY ('{1,3,2}'::integer[])))
Planning time : 3.944 ms
Trigger times:
Trigger Name:Total time:Calls:Average time:
for constraint fkey_cached_gl_account_days_updated_by 123.843 ms 15033 0.008 ms