explain.depesz.com

PostgreSQL's explain analyze made readable

Result: AZCj : Optimization for: plan #l1Ntj

Settings

Optimization path:

# exclusive inclusive rows x rows loops node
1. 1.385 27,521.662 ↓ 6.0 290 1

Sort (cost=277,948.37..277,948.49 rows=48 width=318) (actual time=27,521.650..27,521.662 rows=290 loops=1)

  • Sort Key: cecespitemov.ca_codice, cecespite.sp_anno_acquisto, cecespite.sp_codice, cecespitemov.sp_data_registrazione, cecespitemov.op_codice
  • Sort Method: quicksort Memory: 102kB
2. 2.392 27,520.277 ↓ 6.0 290 1

Nested Loop Left Join (cost=0.56..277,947.03 rows=48 width=318) (actual time=139.651..27,520.277 rows=290 loops=1)

  • Join Filter: (ceoperativo.op_codice = cecespitemov.op_codice)
  • Rows Removed by Join Filter: 2157
3. 1.081 19,537.665 ↓ 6.0 290 1

Nested Loop Left Join (cost=0.56..2,317.33 rows=48 width=173) (actual time=110.493..19,537.665 rows=290 loops=1)

4. 3.938 19,534.844 ↓ 6.0 290 1

Nested Loop (cost=0.41..2,308.79 rows=48 width=141) (actual time=110.483..19,534.844 rows=290 loops=1)

5. 2.394 2.394 ↑ 1.0 1,581 1

Seq Scan on cecespite (cost=0.00..116.69 rows=1,581 width=56) (actual time=0.018..2.394 rows=1,581 loops=1)

  • Filter: (sp_data_alienazione IS NOT NULL)
  • Rows Removed by Filter: 4650
6. 19,528.512 19,528.512 ↓ 0.0 0 1,581

Index Scan using cecespitemov_pkey on cecespitemov (cost=0.41..1.38 rows=1 width=89) (actual time=12.009..12.352 rows=0 loops=1,581)

  • Index Cond: ((ca_codice = cecespite.ca_codice) AND (sp_anno_acquisto = cecespite.sp_anno_acquisto) AND (sp_codice = cecespite.sp_codice))
  • Filter: ((sp_data_registrazione <= '31-01-2015'::date) AND (cespite_alieli_anno((ca_codice)::text, (sp_anno_acquisto)::text, sp_codice, '2015'::text) = 1))
  • Rows Removed by Filter: 9
7. 1.740 1.740 ↑ 1.0 1 290

Index Scan using cecategoria_pkey on cecategoria (cost=0.14..0.18 rows=1 width=36) (actual time=0.006..0.006 rows=1 loops=290)

  • Index Cond: (ca_codice = cecespitemov.ca_codice)
8. 0.276 0.290 ↑ 4.9 8 290

Materialize (cost=0.00..1.31 rows=39 width=31) (actual time=0.001..0.001 rows=8 loops=290)

9. 0.014 0.014 ↑ 1.2 32 1

Seq Scan on ceoperativo (cost=0.00..1.12 rows=39 width=31) (actual time=0.007..0.014 rows=32 loops=1)

10.          

SubPlan (forNested Loop Left Join)

11. 0.580 7,979.930 ↓ 0.0 0 290

Group (cost=5,741.89..5,741.90 rows=1 width=24) (actual time=27.517..27.517 rows=0 loops=290)

  • Group Key: snsottoc.sot_descrizione
12. 1.740 7,979.350 ↓ 0.0 0 290

Sort (cost=5,741.89..5,741.90 rows=1 width=24) (actual time=27.515..27.515 rows=0 loops=290)

  • Sort Key: snsottoc.sot_descrizione
  • Sort Method: quicksort Memory: 25kB
13. 1.160 7,977.610 ↓ 0.0 0 290

Nested Loop Left Join (cost=0.29..5,741.88 rows=1 width=24) (actual time=27.509..27.509 rows=0 loops=290)

14. 7,976.450 7,976.450 ↓ 0.0 0 290

Seq Scan on cvfattut (cost=0.00..5,739.59 rows=1 width=7) (actual time=27.505..27.505 rows=0 loops=290)

  • Filter: (((fav_gruppo = cecespitemov.gruppo_documento) AND (fav_numero = cecespitemov.numero_documento)) OR ((((fav_numero)::character varying)::text = (ce
  • Rows Removed by Filter: 122725
15. 0.000 0.000 ↓ 0.0 0

Index Scan using snsottoc_pkey on snsottoc (cost=0.29..2.29 rows=1 width=31) (never executed)

  • Index Cond: (sottoconto = cvfattut.sottoconto)