explain.depesz.com

PostgreSQL's explain analyze made readable

Result: RgE5

Settings
# exclusive inclusive rows x rows loops node
1. 0.272 3.848 ↑ 5.8 15 1

HashAggregate (cost=486,802.28..486,804.24 rows=87 width=39) (actual time=3.843..3.848 rows=15 loops=1)

  • Group Key: items.invoice_description, details.att_value, items.sr_vat_type, vat.vat_percentage
  • Filter: ((sum(items.sr_amount) > 0::numeric) OR (sum(items.sr_amount) < 0::numeric))
2. 0.770 3.576 ↑ 10.5 559 1

Nested Loop (cost=1.29..486,699.87 rows=5,852 width=39) (actual time=0.044..3.576 rows=559 loops=1)

  • Join Filter: ((items.sr_vat_type)::text = (vat.code)::text)
  • Rows Removed by Join Filter: 3,913
3. 0.043 2.806 ↑ 10.5 559 1

Nested Loop (cost=1.29..485,996.53 rows=5,852 width=31) (actual time=0.035..2.806 rows=559 loops=1)

4. 0.332 0.527 ↑ 5.9 559 1

Nested Loop (cost=0.72..3,655.20 rows=3,296 width=30) (actual time=0.025..0.527 rows=559 loops=1)

5. 0.008 0.008 ↑ 1.0 1 1

Index Only Scan using stt_ibs_obs_statement_pkey on stt_ibs_obs_statement statement (cost=0.28..2.50 rows=1 width=8) (actual time=0.008..0.008 rows=1 loops=1)

  • Index Cond: (id = 177,593,827)
  • Heap Fetches: 1
6. 0.187 0.187 ↑ 5.9 559 1

Index Scan using stt_obs_statement_items_statement_id_idx on stt_obs_statement_items items (cost=0.43..3,619.75 rows=3,296 width=38) (actual time=0.014..0.187 rows=559 loops=1)

  • Index Cond: (statement_id = 177,593,827)
  • Filter: ((status)::text <> 'Canceled'::text)
7. 2.236 2.236 ↑ 59.0 1 559

Index Scan using stt_obs_statement_items_detail_item_id_idx on stt_obs_statement_item_detail details (cost=0.57..145.75 rows=59 width=17) (actual time=0.003..0.004 rows=1 loops=559)

  • Index Cond: (obs_statement_item_id = items.id)
  • Filter: ((att_name)::text = 'city'::text)
  • Rows Removed by Filter: 7
8. 0.000 0.000 ↑ 1.0 8 559

Materialize (cost=0.00..1.12 rows=8 width=11) (actual time=0.000..0.000 rows=8 loops=559)

9. 0.003 0.003 ↑ 1.0 8 1

Seq Scan on act_vat_setup vat (cost=0.00..1.08 rows=8 width=11) (actual time=0.002..0.003 rows=8 loops=1)

Planning time : 0.425 ms
Execution time : 3.934 ms