explain.depesz.com

PostgreSQL's explain analyze made readable

Result: XCqQ

Settings
# exclusive inclusive rows x rows loops node
1. 81.986 29,558.892 ↓ 1,701.0 1,701 1

GroupAggregate (cost=320.80..320.86 rows=1 width=64) (actual time=29,459.687..29,558.892 rows=1,701 loops=1)

  • Group Key: gl_activity.cid, gl_activity.property_id, gl_activity.gl_account_id
  • Buffers: shared hit=5634276
2. 137.634 29,476.906 ↓ 276,375.0 276,375 1

Sort (cost=320.80..320.81 rows=1 width=37) (actual time=29,459.283..29,476.906 rows=276,375 loops=1)

  • Sort Key: gl_activity.property_id, gl_activity.gl_account_id
  • Sort Method: quicksort Memory: 33880kB
  • Buffers: shared hit=5634276
3. 41.043 29,339.272 ↓ 276,375.0 276,375 1

Nested Loop (cost=1.79..320.79 rows=1 width=37) (actual time=52.786..29,339.272 rows=276,375 loops=1)

  • Buffers: shared hit=5634273
4. 2.540 19.098 ↓ 623.0 623 1

Nested Loop (cost=0.99..130.47 rows=1 width=20) (actual time=0.025..19.098 rows=623 loops=1)

  • Buffers: shared hit=4108
5. 2.982 11.574 ↓ 207.7 623 1

Nested Loop (cost=0.70..124.34 rows=3 width=20) (actual time=0.018..11.574 rows=623 loops=1)

  • Buffers: shared hit=2239
6. 2.362 2.362 ↓ 14.8 623 1

Index Scan using uk_gl_account_trees_gl_account_id on gl_account_trees gat (cost=0.42..43.68 rows=42 width=12) (actual time=0.010..2.362 rows=623 loops=1)

  • Index Cond: ((cid = 13576) AND (gl_tree_id = 2718))
  • Buffers: shared hit=362
7. 6.230 6.230 ↑ 1.0 1 623

Index Scan using idx_gl_accounts_id on gl_accounts ga (cost=0.29..1.92 rows=1 width=8) (actual time=0.010..0.010 rows=1 loops=623)

  • Index Cond: (id = gat.gl_account_id)
  • Filter: ((is_confidential IS FALSE) AND (cid = 13576))
  • Rows Removed by Filter: 0
  • Buffers: shared hit=1877
8. 4.984 4.984 ↑ 1.0 1 623

Index Scan using idx_gl_branches_id on gl_branches gb (cost=0.29..2.04 rows=1 width=12) (actual time=0.008..0.008 rows=1 loops=623)

  • Index Cond: (id = gat.gl_branch_id)
  • Filter: (cid = 13576)
  • Buffers: shared hit=1869
9. 55.447 29,279.131 ↓ 444.0 444 623

Nested Loop (cost=0.81..190.30 rows=1 width=33) (actual time=29.116..46.997 rows=444 loops=623)

  • Buffers: shared hit=5630165
10. 13.706 13.706 ↓ 7.0 7 623

Function Scan on load_properties load_prop (cost=0.25..2.00 rows=1 width=4) (actual time=0.011..0.022 rows=7 loops=623)

  • Filter: ((is_disabled = 0) AND (is_test = 0))
  • Buffers: shared hit=2492
11. 29,209.978 29,209.978 ↓ 63.0 63 4,361

Index Scan using uk_cached_gl_account_periods_all_ids_post_month on cached_gl_account_periods gl_activity (cost=0.56..188.27 rows=1 width=33) (actual time=5.999..6.698 rows=63 loops=4,361)

  • Index Cond: ((cid = 13576) AND (property_id = load_prop.property_id) AND (gl_account_id = gat.gl_account_id) AND (gl_book_id = 937) AND (post_month < '2019-06-01'::date) AND (is_temporary = false))
  • Filter: (is_temporary IS FALSE)
  • Buffers: shared hit=5627673
Planning time : 3.332 ms
Execution time : 29,561.489 ms