explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Rat2

Settings
# exclusive inclusive rows x rows loops node
1. 0.000 26,331.734 ↓ 2.0 2 1

Sort (cost=88,027.34..88,027.35 rows=1 width=8,070) (actual time=26,331.732..26,331.734 rows=2 loops=1)

  • Sort Key: b.eu, (CASE WHEN (b.flg_tipo_codifica = 1) THEN b.codifica_dpr118 ELSE b.codifica END)
  • Sort Method: quicksort Memory: 27kB
  • Buffers: shared hit=1346985
2. 0.084 26,331.653 ↓ 2.0 2 1

Nested Loop Left Join (cost=87,828.47..88,027.33 rows=1 width=8,070) (actual time=26,320.126..26,331.653 rows=2 loops=1)

  • Buffers: shared hit=1346980
3. 24.283 26,331.569 ↓ 2.0 2 1

Hash Left Join (cost=87,828.19..88,026.93 rows=1 width=4,178) (actual time=26,320.082..26,331.569 rows=2 loops=1)

  • Hash Cond: (b.id_responsabile = orgdacorga1_.pkid)
  • Filter: ((upper((b.des)::text) ~~ '%%ART BONUS%%'::text) OR (upper((orgdacorga1_.denominazione)::text) ~~ '%%ART BONUS%%'::text))
  • Rows Removed by Filter: 4398
  • Buffers: shared hit=1346972
4. 13,031.487 26,307.286 ↓ 1.1 4,400 1

HashAggregate (cost=87,486.37..87,528.21 rows=4,184 width=209) (actual time=26,299.993..26,307.286 rows=4,400 loops=1)

  • Buffers: shared hit=1346731
5. 3,283.556 13,275.799 ↓ 38.8 2,097,596 1

Nested Loop (cost=844.68..77,214.78 rows=54,061 width=209) (actual time=18.294..13,275.799 rows=2,097,596 loops=1)

  • Join Filter: (COALESCE(imp.anno_competenza, e.anno) <= (e.anno + 2))
  • Rows Removed by Join Filter: 40169
  • Buffers: shared hit=1346731
6. 0.046 0.046 ↑ 1.0 1 1

Index Only Scan using fin_anni_idx0 on fin_anni e (cost=0.29..1.70 rows=1 width=4) (actual time=0.044..0.046 rows=1 loops=1)

  • Index Cond: (anno = 2019)
  • Heap Fetches: 0
  • Buffers: shared hit=3
7. 9,942.349 9,992.197 ↓ 13.2 2,137,765 1

Nested Loop Left Join (cost=844.40..74,780.33 rows=162,183 width=205) (actual time=18.239..9,992.197 rows=2,137,765 loops=1)

  • Join Filter: (imp.data_valuta <= d.data_rif)
  • Rows Removed by Join Filter: 18677
  • Buffers: shared hit=1346728
8. 6.919 49.848 ↓ 4.4 4,400 1

Nested Loop (cost=843.97..955.29 rows=995 width=158) (actual time=18.211..49.848 rows=4,400 loops=1)

  • Buffers: shared hit=752
9. 0.053 0.053 ↑ 1.0 1 1

Index Only Scan using fin_date_idx0 on fin_date_rif d (cost=0.29..1.71 rows=1 width=8) (actual time=0.051..0.053 rows=1 loops=1)

  • Index Cond: (data_rif = '2019-12-31 00:00:00'::timestamp without time zone)
  • Filter: (data_rif = data_rif)
  • Heap Fetches: 0
  • Buffers: shared hit=3
10. 42.876 42.876 ↓ 4.4 4,400 1

Hash Join (cost=843.68..943.63 rows=995 width=150) (actual time=18.155..42.876 rows=4,400 loops=1)

  • Hash Cond: (f.id_ascendente = b.pkid)
  • Buffers: shared hit=749
11. 0.000 5.568 ↑ 1.0 4,400 1

Seq Scan on fin_bilancio_flat f (cost=0.00..68.00 rows=4,400 width=8) (actual time=0.004..5.568 rows=4,400 loops=1)

  • Buffers: shared hit=24
12. 5.326 18.121 ↓ 2.1 4,400 1

Hash (cost=817.53..817.53 rows=2,092 width=146) (actual time=18.121..18.121 rows=4,400 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 791kB
  • Buffers: shared hit=725
13. 12.795 12.795 ↓ 2.1 4,400 1

Seq Scan on fin_bilancio b (cost=0.00..817.53 rows=2,092 width=146) (actual time=0.013..12.795 rows=4,400 loops=1)

  • Filter: ((data_fin IS NULL) AND (data_fin IS NULL))
  • Rows Removed by Filter: 4853
  • Buffers: shared hit=725
14. 6,617.600 6,617.600 ↑ 1.8 490 4,400

Index Scan using fin_eventi_idxf30 on fin_eventi imp (cost=0.43..63.11 rows=887 width=63) (actual time=0.009..1.504 rows=490 loops=4,400)

  • Index Cond: (f.id_discendente = id_bilancio)
  • Buffers: shared hit=1345976
15. 6.939 14.356 ↑ 1.0 4,481 1

Hash (cost=285.81..285.81 rows=4,481 width=3,892) (actual time=14.356..14.356 rows=4,481 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 977kB
  • Buffers: shared hit=241
16. 7.417 7.417 ↑ 1.0 4,481 1

Seq Scan on org_organigramma orgdacorga1_ (cost=0.00..285.81 rows=4,481 width=3,892) (actual time=0.014..7.417 rows=4,481 loops=1)

  • Buffers: shared hit=241
17. 0.052 0.052 ↑ 1.0 1 2

Index Scan using org_organigramma_pk on org_organigramma orgdacorga2_ (cost=0.28..0.39 rows=1 width=3,892) (actual time=0.021..0.026 rows=1 loops=2)

  • Index Cond: (b.id_responsabile_proc = pkid)
  • Buffers: shared hit=8