explain.depesz.com

PostgreSQL's explain analyze made readable

Result: KMln

Settings
# exclusive inclusive rows x rows loops node
1. 0.086 767.084 ↓ 691.0 691 1

Unique (cost=64,120.84..64,120.85 rows=1 width=4) (actual time=766.971..767.084 rows=691 loops=1)

2. 0.197 766.998 ↓ 919.0 919 1

Sort (cost=64,120.84..64,120.84 rows=1 width=4) (actual time=766.970..766.998 rows=919 loops=1)

  • Sort Key: v_no_ass2.id_caso
  • Sort Method: quicksort Memory: 68kB
3. 0.053 766.801 ↓ 919.0 919 1

Subquery Scan on v_no_ass2 (cost=64,120.81..64,120.83 rows=1 width=4) (actual time=766.402..766.801 rows=919 loops=1)

4. 3.291 766.748 ↓ 919.0 919 1

HashAggregate (cost=64,120.81..64,120.82 rows=1 width=74) (actual time=766.401..766.748 rows=919 loops=1)

5. 0.119 763.457 ↓ 1,915.0 1,915 1

Nested Loop (cost=51,876.22..64,120.76 rows=1 width=74) (actual time=616.974..763.457 rows=1,915 loops=1)

6. 7.217 757.587 ↓ 1,917.0 1,917 1

Nested Loop (cost=51,875.79..64,115.14 rows=1 width=62) (actual time=616.966..757.587 rows=1,917 loops=1)

  • Join Filter: ((t_caso.tp_accesso)::text = (t_tp_accesso.tp_accesso)::text)
  • Rows Removed by Join Filter: 24921
7. 1.613 744.619 ↓ 1,917.0 1,917 1

Nested Loop (cost=51,875.79..64,113.76 rows=1 width=60) (actual time=616.950..744.619 rows=1,917 loops=1)

  • Join Filter: ((b.id_acc_mat = t_caso.id_acc_mat) AND (((t_caso.fl_stato)::text <> ALL ('{I,P,V,R,Z,F}'::text[])) OR ((b.splittato)::text = 'S'::text)))
  • Rows Removed by Join Filter: 4956
8. 3.586 722.387 ↓ 6,873.0 6,873 1

Nested Loop Left Join (cost=51,875.37..64,108.69 rows=1 width=42) (actual time=616.846..722.387 rows=6,873 loops=1)

  • Filter: (c.dt_cancel IS NULL)
  • Rows Removed by Filter: 1
9. 12.002 705.053 ↓ 6,874.0 6,874 1

Hash Join (cost=51,874.94..64,103.52 rows=1 width=30) (actual time=616.830..705.053 rows=6,874 loops=1)

  • Hash Cond: ((b.id_acc_mat = t_prelievo.id_acc_mat) AND (b.id_prelievo = t_prelievo.id_prelievo))
10. 76.602 76.602 ↑ 8.5 6,879 1

Seq Scan on t_blocchetto b (cost=0.00..10,621.42 rows=58,442 width=24) (actual time=0.020..76.602 rows=6,879 loops=1)

  • Filter: ((dt_cancel IS NULL) AND (((fl_estemporanea)::text <> 'S'::text) OR (fl_estemporanea IS NULL)) AND ((tp_inclusione IS NULL) OR ((tp_inclusione)::text <> 'O'::text)) AND (user_inclusione = 0) A (...)
  • Rows Removed by Filter: 252695
11. 277.412 616.449 ↑ 1.0 1,163,610 1

Hash (cost=34,418.00..34,418.00 rows=1,163,796 width=14) (actual time=616.449..616.449 rows=1,163,610 loops=1)

  • Buckets: 131072 Batches: 1 Memory Usage: 54523kB
12. 339.037 339.037 ↑ 1.0 1,163,610 1

Seq Scan on t_prelievo (cost=0.00..34,418.00 rows=1,163,796 width=14) (actual time=0.033..339.037 rows=1,163,610 loops=1)

  • Filter: (dt_cancel IS NULL)
  • Rows Removed by Filter: 9690
13. 13.748 13.748 ↑ 1.0 1 6,874

Index Scan using p_t_campionamento on t_campionamento c (cost=0.43..5.16 rows=1 width=24) (actual time=0.002..0.002 rows=1 loops=6,874)

  • Index Cond: (b.id_campionamento = id_campionamento)
14. 20.619 20.619 ↑ 1.0 1 6,873

Index Scan using t_caso2 on t_caso (cost=0.43..5.04 rows=1 width=40) (actual time=0.002..0.003 rows=1 loops=6,873)

  • Index Cond: (id_acc_mat = t_prelievo.id_acc_mat)
  • Filter: ((dt_cancel IS NULL) AND (id_caso_p = id_caso))
  • Rows Removed by Filter: 0
15. 5.751 5.751 ↑ 1.0 14 1,917

Seq Scan on t_tp_accesso (cost=0.00..1.21 rows=14 width=5) (actual time=0.001..0.003 rows=14 loops=1,917)

  • Filter: (dt_cancel IS NULL)
  • Rows Removed by Filter: 7
16. 5.751 5.751 ↑ 1.0 1 1,917

Index Scan using p_t_paziente on t_paziente (cost=0.42..5.61 rows=1 width=20) (actual time=0.002..0.003 rows=1 loops=1,917)

  • Index Cond: (id_paziente = t_caso.id_paziente)
  • Filter: (dt_cancel IS NULL)
Total runtime : 777.002 ms