explain.depesz.com

PostgreSQL's explain analyze made readable

Result: sIEe

Settings
# exclusive inclusive rows x rows loops node
1. 0.069 601.612 ↓ 154.0 154 1

Subquery Scan on trial_balance (cost=23.07..23.41 rows=1 width=173) (actual time=596.138..601.612 rows=154 loops=1)

2. 5.920 601.543 ↓ 154.0 154 1

GroupAggregate (cost=23.07..23.40 rows=1 width=416) (actual time=596.137..601.543 rows=154 loops=1)

  • Group Key: p.property_name, gat.formatted_account_number, p.id, gat.grouping_gl_account_id, gat.name, gat.details, gat.hide_account_balance_from_reports
  • Filter: CASE WHEN (max(gat.disabled_by) IS NOT NULL) THEN ((COALESCE(sum(tbr_data.current_amount_debits), '0'::numeric) <> '0'::numeric) OR (COALESCE(sum(tbr_data.current_amount_credits), '0'::numeric) <> '0'::numeric) OR (sum(COALESCE(tbr_data.opening_balance, '0'::numeric)) <> '0'::numeric)) ELSE ((COALESCE(sum(tbr_data.current_amount_debits), '0'::numeric) <> '0'::numeric) OR (COALESCE(sum(tbr_data.current_amount_credits), '0'::numeric) <> '0'::numeric) OR (sum(COALESCE(tbr_data.opening_balance, '0'::numeric)) <> '0'::numeric)) END
  • Rows Removed by Filter: 1010
3. 6.644 595.623 ↓ 1,216.0 1,216 1

Sort (cost=23.07..23.08 rows=1 width=384) (actual time=595.419..595.623 rows=1,216 loops=1)

  • Sort Key: p.property_name, gat.formatted_account_number, p.id, gat.grouping_gl_account_id, gat.name, gat.details
  • Sort Method: quicksort Memory: 233kB
4. 70.074 588.979 ↓ 1,216.0 1,216 1

Nested Loop Left Join (cost=0.95..23.06 rows=1 width=384) (actual time=444.839..588.979 rows=1,216 loops=1)

  • Join Filter: ((tbr_data.cid = p.cid) AND (tbr_data.property_id = p.id) AND (tbr_data.gl_account_id = gat.gl_account_id))
  • Rows Removed by Join Filter: 277957
5. 1.794 453.721 ↓ 1,164.0 1,164 1

Nested Loop (cost=0.95..18.06 rows=1 width=296) (actual time=444.680..453.721 rows=1,164 loops=1)

6. 0.659 448.435 ↓ 1,164.0 1,164 1

Nested Loop (cost=0.67..9.45 rows=1 width=277) (actual time=444.640..448.435 rows=1,164 loops=1)

7. 1.964 1.964 ↓ 1,164.0 1,164 1

Index Scan using uk_gl_account_trees_gl_account_id on gl_account_trees gat (cost=0.42..8.44 rows=1 width=273) (actual time=0.024..1.964 rows=1,164 loops=1)

  • Index Cond: ((cid = 224) AND (gl_tree_id = 232))
  • Filter: (hide_account_balance_from_reports = 0)
8. 445.812 445.812 ↑ 1.0 1 1,164

Function Scan on load_properties load_prop (cost=0.25..1.00 rows=1 width=4) (actual time=0.382..0.383 rows=1 loops=1,164)

  • Filter: ((is_disabled = 0) AND (is_test = 0))
9. 3.492 3.492 ↑ 1.0 1 1,164

Index Scan using idx_properties_id on properties p (cost=0.28..8.30 rows=1 width=27) (actual time=0.003..0.003 rows=1 loops=1,164)

  • Index Cond: (id = load_prop.property_id)
  • Filter: (cid = 224)
10. 65.184 65.184 ↓ 239.0 239 1,164

Seq Scan on temp_tbal_data tbr_data (cost=0.00..4.99 rows=1 width=120) (actual time=0.003..0.056 rows=239 loops=1,164)

  • Filter: (cid = 224)
Planning time : 2.956 ms