explain.depesz.com

PostgreSQL's explain analyze made readable

Result: p2E2

Settings
# exclusive inclusive rows x rows loops node
1. 565.402 72,679.707 ↓ 1,299.0 1,299 1

GroupAggregate (cost=261.69..261.75 rows=1 width=69) (actual time=72,016.015..72,679.707 rows=1,299 loops=1)

  • Group Key: gd.cid, gd.property_id, gd.cash_gl_account_id
2. 542.752 72,114.305 ↓ 556,269.0 556,269 1

Sort (cost=261.69..261.70 rows=1 width=42) (actual time=72,015.320..72,114.305 rows=556,269 loops=1)

  • Sort Key: gd.property_id, gd.cash_gl_account_id
  • Sort Method: quicksort Memory: 68035kB
3. 742.735 71,571.553 ↓ 556,269.0 556,269 1

Nested Loop Left Join (cost=2.38..261.68 rows=1 width=42) (actual time=119.773..71,571.553 rows=556,269 loops=1)

4. 739.801 68,603.742 ↓ 556,269.0 556,269 1

Nested Loop (cost=1.96..253.23 rows=1 width=38) (actual time=119.752..68,603.742 rows=556,269 loops=1)

5. 221.965 65,024.351 ↓ 567,918.0 567,918 1

Nested Loop (cost=1.52..252.27 rows=1 width=34) (actual time=119.732..65,024.351 rows=567,918 loops=1)

6. 17.050 17.050 ↓ 12.0 12 1

Function Scan on load_properties load_prop (cost=0.25..1.00 rows=1 width=4) (actual time=16.977..17.050 rows=12 loops=1)

  • Filter: ((is_disabled = 0) AND (is_test = 0))
7. 403.056 64,785.336 ↓ 47,326.0 47,326 12

Nested Loop (cost=1.27..251.26 rows=1 width=34) (actual time=50.947..5,398.778 rows=47,326 loops=12)

8. 29.568 128.328 ↓ 1,162.0 1,162 12

Nested Loop (cost=0.71..16.82 rows=1 width=12) (actual time=0.031..10.694 rows=1,162 loops=12)

9. 29.040 29.040 ↓ 1,162.0 1,162 12

Index Scan using uk_gl_account_trees_gl_account_id on gl_account_trees gat (cost=0.42..8.44 rows=1 width=12) (actual time=0.024..2.420 rows=1,162 loops=12)

  • Index Cond: ((cid = 224) AND (gl_tree_id = 232))
10. 69.720 69.720 ↑ 1.0 1 13,944

Index Scan using idx_gl_branches_id on gl_branches gb (cost=0.29..8.31 rows=1 width=12) (actual time=0.005..0.005 rows=1 loops=13,944)

  • Index Cond: (id = gat.gl_branch_id)
  • Filter: (cid = 224)
11. 64,253.952 64,253.952 ↓ 10.2 41 13,944

Index Scan using idx_gl_details_cid_property_id_post_month_cash_gl_account_id on gl_details gd (cost=0.56..234.40 rows=4 width=30) (actual time=3.982..4.608 rows=41 loops=13,944)

  • Index Cond: ((cid = 224) AND (property_id = load_prop.property_id) AND (cash_gl_account_id = gat.gl_account_id))
12. 2,839.590 2,839.590 ↑ 1.0 1 567,918

Index Scan using idx_gl_headers_id on gl_headers gh (cost=0.43..0.96 rows=1 width=12) (actual time=0.005..0.005 rows=1 loops=567,918)

  • Index Cond: (id = gd.gl_header_id)
  • Filter: ((NOT is_template) AND (post_month < '2019-07-01'::date) AND (cid = 224) AND (gl_book_id = 132) AND (gl_header_status_type_id <> ALL ('{2,4,5,6}'::integer[])))
  • Rows Removed by Filter: 0
13. 2,225.076 2,225.076 ↑ 1.0 1 556,269

Index Scan using pk_company_users on company_users cu (cost=0.42..8.45 rows=1 width=4) (actual time=0.004..0.004 rows=1 loops=556,269)

  • Index Cond: ((cid = 224) AND (id = 140))
Planning time : 4.868 ms