explain.depesz.com

PostgreSQL's explain analyze made readable

Result: SFLN

Settings
# exclusive inclusive rows x rows loops node
1. 82.441 3,262.359 ↓ 1,701.0 1,701 1

GroupAggregate (cost=409.17..409.23 rows=1 width=64) (actual time=3,164.661..3,262.359 rows=1,701 loops=1)

  • Group Key: gl_activity.cid, gl_activity.property_id, gl_activity.gl_account_id
  • Buffers: shared hit=703,979, local hit=1
2. 119.111 3,179.918 ↓ 276,375.0 276,375 1

Sort (cost=409.17..409.17 rows=1 width=37) (actual time=3,164.271..3,179.918 rows=276,375 loops=1)

  • Sort Key: gl_activity.property_id, gl_activity.gl_account_id
  • Sort Method: quicksort Memory: 33,880kB
  • Buffers: shared hit=703,979, local hit=1
3. 1,171.151 3,060.807 ↓ 276,375.0 276,375 1

Nested Loop Semi Join (cost=1.42..409.16 rows=1 width=37) (actual time=0.285..3,060.807 rows=276,375 loops=1)

  • Join Filter: (gl_activity.property_id = lp.property_id)
  • Rows Removed by Join Filter: 7,372,002
  • Buffers: shared hit=703,976, local hit=1
4. 188.329 1,889.656 ↓ 161,138.2 1,289,106 1

Nested Loop (cost=1.42..405.97 rows=8 width=37) (actual time=0.174..1,889.656 rows=1,289,106 loops=1)

  • Join Filter: (gat.gl_account_id = gl_activity.gl_account_id)
  • Buffers: shared hit=703,976
5. 0.445 5.521 ↓ 623.0 623 1

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

  • Buffers: shared hit=4,108
6. 0.628 3.830 ↓ 207.7 623 1

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

  • Buffers: shared hit=2,239
7. 1.333 1.333 ↓ 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.048..1.333 rows=623 loops=1)

  • Index Cond: ((cid = 13,576) AND (gl_tree_id = 2,718))
  • Buffers: shared hit=362
8. 1.869 1.869 ↑ 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.003..0.003 rows=1 loops=623)

  • Index Cond: (id = gat.gl_account_id)
  • Filter: ((is_confidential IS FALSE) AND (cid = 13,576))
  • Rows Removed by Filter: 0
  • Buffers: shared hit=1,877
9. 1.246 1.246 ↑ 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.002..0.002 rows=1 loops=623)

  • Index Cond: (id = gat.gl_branch_id)
  • Filter: (cid = 13,576)
  • Buffers: shared hit=1,869
10. 1,695.806 1,695.806 ↓ 5.4 2,069 623

Index Scan using idx_cached_gl_account_periods_gl_account_id on cached_gl_account_periods gl_activity (cost=0.43..263.09 rows=382 width=33) (actual time=0.012..2.722 rows=2,069 loops=623)

  • Index Cond: (gl_account_id = ga.id)
  • Filter: ((is_temporary IS FALSE) AND (post_month < '06/01/2019'::date) AND (cid = 13,576) AND (gl_book_id = 937))
  • Rows Removed by Filter: 640
  • Buffers: shared hit=699,868
11. 0.000 0.000 ↑ 1.2 6 1,289,106

Materialize (cost=0.00..1.24 rows=7 width=4) (actual time=0.000..0.000 rows=6 loops=1,289,106)

  • Buffers: local hit=1
12. 0.006 0.006 ↑ 1.0 7 1

Seq Scan on lp (cost=0.00..1.21 rows=7 width=4) (actual time=0.006..0.006 rows=7 loops=1)

  • Buffers: local hit=1
Planning time : 5.026 ms
Execution time : 3,264.203 ms