explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 4d3p

Settings
# exclusive inclusive rows x rows loops node
1. 0.138 274.426 ↓ 304.0 304 1

Subquery Scan on trial_balance (cost=32.68..33.07 rows=1 width=195) (actual time=266.062..274.426 rows=304 loops=1)

2. 8.259 274.288 ↓ 304.0 304 1

GroupAggregate (cost=32.68..33.06 rows=1 width=437) (actual time=266.060..274.288 rows=304 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: 602
3. 4.929 266.029 ↓ 1,092.0 1,092 1

Sort (cost=32.68..32.68 rows=1 width=386) (actual time=265.828..266.029 rows=1,092 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: 220kB
4. 120.926 261.100 ↓ 1,092.0 1,092 1

Nested Loop Left Join (cost=0.96..32.67 rows=1 width=386) (actual time=12.052..261.100 rows=1,092 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: 524902
5. 1.129 16.958 ↓ 906.0 906 1

Nested Loop (cost=0.96..19.37 rows=1 width=281) (actual time=11.747..16.958 rows=906 loops=1)

6. 0.627 13.111 ↓ 906.0 906 1

Nested Loop (cost=0.68..9.46 rows=1 width=266) (actual time=11.737..13.111 rows=906 loops=1)

7. 0.404 0.404 ↓ 302.0 302 1

Index Scan using uk_gl_account_trees_gl_account_id on gl_account_trees gat (cost=0.43..8.45 rows=1 width=262) (actual time=0.026..0.404 rows=302 loops=1)

  • Index Cond: ((cid = 8839) AND (gl_tree_id = 1708))
  • Filter: (hide_account_balance_from_reports = 0)
8. 12.080 12.080 ↓ 3.0 3 302

Function Scan on load_properties load_prop (cost=0.25..1.00 rows=1 width=4) (actual time=0.039..0.040 rows=3 loops=302)

  • Filter: ((is_disabled = 0) AND (is_test = 0))
9. 2.718 2.718 ↑ 1.0 1 906

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

  • Index Cond: (id = load_prop.property_id)
  • Filter: (cid = 8839)
10. 123.216 123.216 ↓ 193.3 580 906

Seq Scan on temp_tbal_data tbr_data (cost=0.00..13.25 rows=3 width=125) (actual time=0.003..0.136 rows=580 loops=906)

  • Filter: (cid = 8839)
Planning time : 3.101 ms