explain.depesz.com

PostgreSQL's explain analyze made readable

Result: gJ4O

Settings
# exclusive inclusive rows x rows loops node
1. 0.184 3.264 ↑ 5.0 1 1

HashAggregate (cost=488,121.34..488,121.40 rows=5 width=39) (actual time=3.264..3.264 rows=1 loops=1)

  • Group Key: items.invoice_description, details.att_value, items.sr_vat_type, vat.vat_percentage
2. 0.518 3.080 ↓ 1.4 380 1

Nested Loop (cost=1.29..488,117.95 rows=271 width=39) (actual time=0.034..3.080 rows=380 loops=1)

  • Join Filter: ((items.sr_vat_type)::text = (vat.code)::text)
  • Rows Removed by Join Filter: 2,660
3. 0.048 2.562 ↓ 1.4 380 1

Nested Loop (cost=1.29..488,084.33 rows=271 width=31) (actual time=0.027..2.562 rows=380 loops=1)

4. 0.007 0.007 ↑ 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.007..0.007 rows=1 loops=1)

  • Index Cond: (id = 177,593,827)
  • Heap Fetches: 1
5. 0.095 2.507 ↓ 1.4 380 1

Nested Loop (cost=1.01..488,079.13 rows=271 width=39) (actual time=0.019..2.507 rows=380 loops=1)

6. 0.176 0.176 ↑ 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.011..0.176 rows=559 loops=1)

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

Index Scan using stt_obs_statement_items_detail_item_id_idx on stt_obs_statement_item_detail details (cost=0.57..146.95 rows=3 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) AND ((att_value)::text = 'Milano'::text))
  • Rows Removed by Filter: 8
8. 0.000 0.000 ↑ 1.0 8 380

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

9. 0.002 0.002 ↑ 1.0 8 1

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

Planning time : 0.339 ms
Execution time : 3.343 ms