explain.depesz.com

PostgreSQL's explain analyze made readable

Result: wSbD

Settings

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 47.578 177,531.172 ↓ 0.0 0 1

Insert on rif_tmp_progr_microracc (cost=15,215,276.79..15,215,281.60 rows=52 width=3,462) (actual time=177,531.172..177,531.172 rows=0 loops=1)

2. 3.623 177,483.594 ↓ 19.4 1,008 1

Subquery Scan on *SELECT* (cost=15,215,276.79..15,215,281.60 rows=52 width=3,462) (actual time=177,478.690..177,483.594 rows=1,008 loops=1)

3. 0.804 177,479.971 ↓ 19.4 1,008 1

Unique (cost=15,215,276.79..15,215,277.83 rows=52 width=2,940) (actual time=177,478.660..177,479.971 rows=1,008 loops=1)

4. 9.396 177,479.167 ↓ 19.4 1,008 1

Sort (cost=15,215,276.79..15,215,276.92 rows=52 width=2,940) (actual time=177,478.659..177,479.167 rows=1,008 loops=1)

  • Sort Key: xxx.tmp_tipo_rec, xxx.id_sede, xxx.id_punto_raccolta, xxx.id_comp, xxx.id_organizz, xxx.tipo_frequenza, xxx.id_rich_servizio
  • Sort Method: quicksort Memory: 1031kB
5. 1.198 177,469.771 ↓ 19.4 1,008 1

WindowAgg (cost=15,215,274.40..15,215,275.31 rows=52 width=2,940) (actual time=177,468.223..177,469.771 rows=1,008 loops=1)

6. 5.296 177,468.573 ↓ 19.4 1,008 1

Sort (cost=15,215,274.40..15,215,274.53 rows=52 width=2,932) (actual time=177,468.214..177,468.573 rows=1,008 loops=1)

  • Sort Key: xxx.tmp_tipo_rec
  • Sort Method: quicksort Memory: 1028kB
7. 0.599 177,463.277 ↓ 19.4 1,008 1

Subquery Scan on xxx (cost=15,215,271.88..15,215,272.92 rows=52 width=2,932) (actual time=177,461.513..177,463.277 rows=1,008 loops=1)

8. 17.428 177,462.678 ↓ 19.4 1,008 1

HashAggregate (cost=15,215,271.88..15,215,272.40 rows=52 width=2,932) (actual time=177,461.513..177,462.678 rows=1,008 loops=1)

  • Group Key: ('qpkpqpmgdkl611pgd0if0qvggh'::character varying(50)), ('0'::character varying(1)), ('0'::character varying(1)), "*SELECT* 1".tmp_tipo_rec, "*SELECT* 1".tipo_frequenza, "*SELECT* 1".freq_num, "*SELECT* 1".nr_esec_anno, "*SELECT* 1".nr_esec_mese, "*SELECT* 1".nr_esec_sett, "*SELECT* 1".cod_ricorrenza, "*SELECT* 1".descr_ricorrenza, "*SELECT* 1".id_organizz, "*SELECT* 1".data_priorita, "*SELECT* 1".data_ult_esecuzione, "*SELECT* 1".flg_scheda_lav_dedic, (('0'::smallint)::bigint), "*SELECT* 1".note_attivita, "*SELECT* 1".id_soggetto, "*SELECT* 1".id_sede, "*SELECT* 1".ragione_soc_sede, "*SELECT* 1".indirizzo_sede, "*SELECT* 1".cap_sede, "*SELECT* 1".localita_sede, "*SELECT* 1".id_comune_sede, "*SELECT* 1".provincia_sede, "*SELECT* 1".orario_apertura_dalle, "*SELECT* 1".orario_apertura_alle, "*SELECT* 1".id_comp, "*SELECT* 1".cod_componente, "*SELECT* 1".tipo_compo, "*SELECT* 1".descr_tipo_compo, "*SELECT* 1".capacita_comp, "*SELECT* 1".tipo_microracc_comp, "*SELECT* 1".descr_tipo_microracc, "*SELECT* 1".cod_rifiuto_comp, "*SELECT* 1".descr_rifiuto_comp, "*SELECT* 1".classe_omog_comp, "*SELECT* 1".descr_class_om_comp, "*SELECT* 1".note_comp, "*SELECT* 1".id_punto_raccolta, "*SELECT* 1".descr_punto_raccolta, "*SELECT* 1".cod_strada_pr, "*SELECT* 1".des_strada_pr, "*SELECT* 1".civico_pr, "*SELECT* 1".esponente_pr, "*SELECT* 1".localita_pr, "*SELECT* 1".id_comune_pr, "*SELECT* 1".latitudine_pr, "*SELECT* 1".longitudine_pr, "*SELECT* 1".id_note_programm
9. 6.977 177,445.250 ↓ 19.4 1,008 1

Append (cost=1,828.95..15,215,265.38 rows=52 width=2,932) (actual time=196.739..177,445.250 rows=1,008 loops=1)

10. 8.118 177,204.914 ↓ 22.7 816 1

Subquery Scan on *SELECT* 1 (cost=1,828.95..15,207,047.20 rows=36 width=1,807) (actual time=196.738..177,204.914 rows=816 loops=1)

11. 30.584 177,196.796 ↓ 22.7 816 1

Nested Loop Anti Join (cost=1,828.95..15,207,046.75 rows=36 width=1,801) (actual time=196.735..177,196.796 rows=816 loops=1)

  • Join Filter: (sv.id_organizzaz = org.id)
12. 1.146 161,004.516 ↓ 22.7 816 1

Merge Anti Join (cost=1,828.38..15,118,273.31 rows=36 width=1,697) (actual time=174.376..161,004.516 rows=816 loops=1)

  • Merge Cond: (org.id = var.id_organizz)
13. 1.421 161,003.356 ↓ 11.5 816 1

Merge Anti Join (cost=1,811.96..15,118,256.69 rows=71 width=1,697) (actual time=174.360..161,003.356 rows=816 loops=1)

  • Merge Cond: (org.id = tmp_prog.id_organizz)
14. 5.979 161,001.918 ↓ 11.5 816 1

Nested Loop Left Join (cost=1,803.78..15,118,248.32 rows=71 width=1,697) (actual time=174.341..161,001.918 rows=816 loops=1)

  • Join Filter: (tipo_c.id = comp.id_tipo_comp)
  • Rows Removed by Join Filter: 816
15. 8.844 160,994.307 ↓ 11.5 816 1

Nested Loop Left Join (cost=1,803.78..15,118,245.17 rows=71 width=1,559) (actual time=174.331..160,994.307 rows=816 loops=1)

16. 2.463 160,975.671 ↓ 11.5 816 1

Nested Loop Left Join (cost=1,803.64..15,118,233.17 rows=71 width=1,043) (actual time=174.318..160,975.671 rows=816 loops=1)

17. 6.913 160,968.312 ↓ 11.5 816 1

Nested Loop Left Join (cost=1,803.50..15,118,221.35 rows=71 width=905) (actual time=174.311..160,968.312 rows=816 loops=1)

  • Join Filter: (ricorr.id = org.cod_ricorrenza)
  • Rows Removed by Join Filter: 2448
18. 7.069 160,959.767 ↓ 11.5 816 1

Nested Loop Left Join (cost=1,803.50..15,118,216.04 rows=71 width=389) (actual time=174.301..160,959.767 rows=816 loops=1)

19. 7,197.722 160,941.274 ↓ 11.5 816 1

Nested Loop (cost=1,803.22..15,118,147.02 rows=71 width=317) (actual time=174.286..160,941.274 rows=816 loops=1)

  • Join Filter: (punt.id_sede_propr = orari_1.id_sede)
  • Rows Removed by Join Filter: 17852448
20. 3.708 147,860.192 ↓ 34.0 816 1

Nested Loop Left Join (cost=19.13..15,107,993.45 rows=24 width=317) (actual time=113.940..147,860.192 rows=816 loops=1)

21. 1.777 147,844.244 ↓ 34.0 816 1

Nested Loop Left Join (cost=18.98..15,107,989.22 rows=24 width=260) (actual time=113.921..147,844.244 rows=816 loops=1)

  • Join Filter: (orari_apert.id_sede = punt.id_sede_propr)
22. 2,517.944 147,842.467 ↓ 34.0 816 1

Nested Loop (cost=0.42..15,107,970.27 rows=24 width=204) (actual time=113.889..147,842.467 rows=816 loops=1)

  • Join Filter: (comp.id_punto_raccolta = punt.id)
  • Rows Removed by Join Filter: 6077568
23. 6,581.049 143,309.003 ↓ 34.0 816 1

Nested Loop (cost=0.42..15,104,901.52 rows=24 width=109) (actual time=113.867..143,309.003 rows=816 loops=1)

  • Join Filter: (org.id_componente = comp.id)
  • Rows Removed by Join Filter: 13514388
24. 14,202.477 132,315.230 ↓ 39.3 1,649 1

Merge Left Join (cost=0.42..15,098,969.24 rows=42 width=67) (actual time=84.111..132,315.230 rows=1,649 loops=1)

  • Merge Cond: (org.id = giorni.id_organizzaz)
  • Filter: ((((org.tipo_schedulaz)::text = ''::text) AND (giorni.id_organizzaz IS NOT NULL)) OR (((org.tipo_schedulaz)::text = 'F'::text) AND ((((org.freq_su_base)::text = 'A'::text) AND ((SubPlan 12) < org.freq_num)) OR (((org.freq_su_base)::text = 'M'::text) AND ((SubPlan 14) < org.freq_num)) OR (((org.freq_su_base)::text = 'S'::text) AND ((SubPlan 16) < org.freq_num))) AND (alternatives: SubPlan 17 or hashed SubPlan 18)))
  • Rows Removed by Filter: 1
25. 0.000 118,112.732 ↓ 6.5 1,650 1

Index Scan using rif_organizzaz_id on rif_organizzaz org (cost=0.29..15,097,847.36 rows=252 width=31) (actual time=74.631..118,112.732 rows=1,650 loops=1)

  • Filter: (((id_modello_servizio = '0'::bigint) OR (id_modello_servizio IS NULL)) AND (id_componente > 0) AND (concat(CASE WHEN ((mese_ini_progr < 10) OR (mese_ini_progr IS NULL)) THEN CASE WHEN ((mese_ini_progr = '0'::smallint) OR (mese_ini_progr IS NULL)) THEN '00'::text ELSE '0'::text END ELSE ''::text END, CASE WHEN (mese_ini_progr > 0) THEN (mese_ini_progr)::character varying(2) ELSE ''::character varying END, CASE WHEN ((giorno_ini_progr < 10) OR (giorno_ini_progr IS NULL)) THEN CASE WHEN ((giorno_ini_progr = '0'::smallint) OR (giorno_ini_progr IS NULL)) THEN '00'::text ELSE '0'::text END ELSE ''::text END, CASE WHEN (giorno_ini_progr > 0) THEN (giorno_ini_progr)::character varying(2) ELSE ''::character varying END) <= '1008'::text) AND (concat(CASE WHEN ((mese_fine_progr < 10) OR (mese_fine_progr IS NULL)) THEN CASE WHEN ((mese_fine_progr = '0'::smallint) OR (mese_fine_progr IS NULL)) THEN '99'::text ELSE '0'::text END ELSE ''::text END, CASE WHEN (mese_fine_progr > 0) THEN (mese_fine_progr)::character varying(2) ELSE ''::character varying END, CASE WHEN ((giorno_fine_progr < 10) OR (giorno_fine_progr IS NULL)) THEN CASE WHEN ((giorno_fine_progr = '0'::smallint) OR (giorno_fine_progr IS NULL)) THEN '99'::text ELSE '0'::text END ELSE ''::text END, CASE WHEN (giorno_fine_progr > 0) THEN (giorno_fine_progr)::character varying(2) ELSE ''::character varying END) >= '1008'::text) AND (((tipo_schedulaz)::text = ''::text) OR (((tipo_schedulaz)::text = 'F'::text) AND ((((freq_su_base)::text = 'A'::text) AND ((SubPlan 12) < freq_num)) OR (((freq_su_base)::text = 'M'::text) AND ((SubPlan 14) < freq_num)) OR (((freq_su_base)::text = 'S'::text) AND ((SubPlan 16) < freq_num))) AND (alternatives: SubPlan 17 or hashed SubPlan 18))))
  • Rows Removed by Filter: 11961
26.          

SubPlan (forIndex Scan)

27. 45.765 131,742.180 ↑ 1.0 1 15,255

Result (cost=1,059.76..1,059.77 rows=1 width=8) (actual time=8.636..8.636 rows=1 loops=15,255)

28.          

Initplan (forResult)

29. 45.765 131,696.415 ↓ 0.0 0 15,255

GroupAggregate (cost=0.28..1,059.76 rows=3 width=16) (actual time=8.633..8.633 rows=0 loops=15,255)

  • Group Key: sv_4.id_organizzaz
30. 110.205 131,650.650 ↓ 0.0 0 15,255

Nested Loop (cost=0.28..1,059.72 rows=3 width=8) (actual time=7.781..8.630 rows=0 loops=15,255)

31. 131,498.100 131,498.100 ↓ 0.0 0 15,255

Seq Scan on rif_servizi_schede_lav sv_4 (cost=0.00..1,034.78 rows=3 width=16) (actual time=7.772..8.620 rows=0 loops=15,255)

  • Filter: ((flg_segn_srv_non_effett = '0'::bpchar) AND (id_organizzaz = org.id))
  • Rows Removed by Filter: 8797
32. 42.345 42.345 ↑ 1.0 1 2,823

Index Scan using rif_schede_lav_id on rif_schede_lav sl_4 (cost=0.28..8.30 rows=1 width=8) (actual time=0.014..0.015 rows=1 loops=2,823)

  • Index Cond: (id = sv_4.id_scheda_lav)
  • Filter: ((data_esecuzione_prevista >= '20190101'::bpchar) AND (data_esecuzione_prevista <= '20191231'::bpchar))
33. 0.004 0.026 ↑ 1.0 1 2

Result (cost=20.41..20.42 rows=1 width=8) (actual time=0.012..0.013 rows=1 loops=2)

34.          

Initplan (forResult)

35. 0.004 0.022 ↓ 0.0 0 2

GroupAggregate (cost=0.57..20.41 rows=1 width=16) (actual time=0.011..0.011 rows=0 loops=2)

  • Group Key: sv_5.id_organizzaz
36. 0.000 0.018 ↓ 0.0 0 2

Nested Loop (cost=0.57..20.39 rows=1 width=8) (actual time=0.009..0.009 rows=0 loops=2)

37. 0.018 0.018 ↓ 0.0 0 2

Index Only Scan using rif_schede_lav_data_exe_prev_desc on rif_schede_lav sl_5 (cost=0.28..8.30 rows=1 width=8) (actual time=0.009..0.009 rows=0 loops=2)

  • Index Cond: ((data_esecuzione_prevista >= '20191001'::bpchar) AND (data_esecuzione_prevista <= '20191031'::bpchar))
  • Heap Fetches: 0
38. 0.000 0.000 ↓ 0.0 0

Index Scan using rif_servizi_schede_lav_progr_esecuzione on rif_servizi_schede_lav sv_5 (cost=0.29..12.08 rows=1 width=16) (never executed)

  • Index Cond: (id_scheda_lav = sl_5.id)
  • Filter: ((flg_segn_srv_non_effett = '0'::bpchar) AND (id_organizzaz = org.id))
39. 0.002 0.018 ↑ 1.0 1 1

Result (cost=20.41..20.42 rows=1 width=8) (actual time=0.018..0.018 rows=1 loops=1)

40.          

Initplan (forResult)

41. 0.003 0.016 ↓ 0.0 0 1

GroupAggregate (cost=0.57..20.41 rows=1 width=16) (actual time=0.016..0.016 rows=0 loops=1)

  • Group Key: sv_6.id_organizzaz
42. 0.001 0.013 ↓ 0.0 0 1

Nested Loop (cost=0.57..20.39 rows=1 width=8) (actual time=0.013..0.013 rows=0 loops=1)

43. 0.012 0.012 ↓ 0.0 0 1

Index Only Scan using rif_schede_lav_data_exe_prev_desc on rif_schede_lav sl_6 (cost=0.28..8.30 rows=1 width=8) (actual time=0.012..0.012 rows=0 loops=1)

  • Index Cond: ((data_esecuzione_prevista >= '20191007'::bpchar) AND (data_esecuzione_prevista <= '20191013'::bpchar))
  • Heap Fetches: 0
44. 0.000 0.000 ↓ 0.0 0

Index Scan using rif_servizi_schede_lav_progr_esecuzione on rif_servizi_schede_lav sv_6 (cost=0.29..12.08 rows=1 width=16) (never executed)

  • Index Cond: (id_scheda_lav = sl_6.id)
  • Filter: ((flg_segn_srv_non_effett = '0'::bpchar) AND (id_organizzaz = org.id))
45. 41.225 41.225 ↑ 1.0 1 1,649

Index Only Scan using rif_org_freq_per_giorni_id on rif_org_freq_per_giorni per_freq (cost=0.41..8.44 rows=1 width=0) (actual time=0.025..0.025 rows=1 loops=1,649)

  • Index Cond: ((id_organizzazione = org.id) AND (da_data <= '20191008'::bpchar) AND (a_data >= '20191008'::bpchar))
  • Heap Fetches: 1649
46. 35.590 35.590 ↑ 5.1 1,709 1

Seq Scan on rif_org_freq_per_giorni per_freq_1 (cost=0.00..1,293.67 rows=8,731 width=8) (actual time=0.049..35.590 rows=1,709 loops=1)

  • Filter: ((da_data <= '20191008'::bpchar) AND (a_data >= '20191008'::bpchar))
  • Rows Removed by Filter: 56136
47. 0.021 0.021 ↓ 0.0 0 1

Index Only Scan using rif_organizzaz_giorni_pk on rif_organizzaz_giorni giorni (cost=0.13..12.17 rows=1 width=44) (actual time=0.021..0.021 rows=0 loops=1)

  • Index Cond: (data = '20191008'::bpchar)
  • Heap Fetches: 0
48. 4,389.189 4,412.724 ↑ 1.0 8,196 1,649

Materialize (cost=0.00..766.70 rows=8,232 width=50) (actual time=0.001..2.676 rows=8,196 loops=1,649)

49. 23.535 23.535 ↑ 1.0 8,196 1

Seq Scan on rif_punti_raccolta_comp comp (cost=0.00..725.54 rows=8,232 width=50) (actual time=0.013..23.535 rows=8,196 loops=1)

  • Filter: ((id_tipo_microraccolta > 0) AND ((data_dismissione = '00000000'::bpchar) OR (data_dismissione = ''::bpchar) OR (data_dismissione IS NULL) OR (data_dismissione > '20191008'::bpchar)))
  • Rows Removed by Filter: 6431
50. 2,010.523 2,015.520 ↑ 1.0 7,449 816

Materialize (cost=0.00..405.38 rows=7,450 width=103) (actual time=0.001..2.470 rows=7,449 loops=816)

51. 4.997 4.997 ↑ 1.0 7,449 1

Seq Scan on rif_punti_raccolta_attr punt (cost=0.00..368.12 rows=7,450 width=103) (actual time=0.009..4.997 rows=7,449 loops=1)

  • Filter: (id_sede_propr > 0)
  • Rows Removed by Filter: 1
52. 0.000 0.000 ↓ 0.0 0 816

Materialize (cost=18.57..18.59 rows=1 width=64) (actual time=0.000..0.000 rows=0 loops=816)

53. 0.002 0.028 ↓ 0.0 0 1

Subquery Scan on orari_apert (cost=18.57..18.59 rows=1 width=64) (actual time=0.028..0.028 rows=0 loops=1)

54. 0.022 0.026 ↓ 0.0 0 1

Sort (cost=18.57..18.57 rows=1 width=128) (actual time=0.026..0.026 rows=0 loops=1)

  • Sort Key: orari.mese_giorno_da, orari.mese_giorno_a, orari.dalle_ore, orari.alle_ore
  • Sort Method: quicksort Memory: 25kB
55. 0.004 0.004 ↓ 0.0 0 1

Index Only Scan using rif_orari_sport_giorni_id on rif_orari_sport_giorni orari (cost=0.15..18.56 rows=1 width=128) (actual time=0.004..0.004 rows=0 loops=1)

  • Index Cond: ((id_sportello = '0'::bigint) AND (mese_giorno_da <= '1008'::text) AND (mese_giorno_a >= '1008'::text) AND (day_of_week = '2'::text) AND (dalle_ore < '123000'::bpchar) AND (alle_ore > '090000'::bpchar))
  • Heap Fetches: 0
56. 12.240 12.240 ↑ 1.0 1 816

Index Scan using rif_anagrafica_rifiuti_key_anagrafica_rifiuti on rif_anagrafica_rifiuti rif (cost=0.14..0.17 rows=1 width=65) (actual time=0.013..0.015 rows=1 loops=816)

  • Index Cond: ((cod_rifiuto)::text = (comp.cod_rifiuto)::text)
57. 5,814.930 5,883.360 ↑ 1.0 21,879 816

Materialize (cost=1,784.09..2,331.11 rows=21,881 width=8) (actual time=0.070..7.210 rows=21,879 loops=816)

58. 21.596 68.430 ↑ 1.0 21,879 1

HashAggregate (cost=1,784.09..2,002.89 rows=21,881 width=8) (actual time=56.775..68.430 rows=21,879 loops=1)

  • Group Key: orari_1.id_sede
59. 18.735 46.834 ↑ 1.0 21,879 1

Append (cost=0.44..1,729.38 rows=21,881 width=8) (actual time=0.013..46.834 rows=21,879 loops=1)

60. 0.001 0.005 ↓ 0.0 0 1

Unique (cost=0.44..20.37 rows=1 width=8) (actual time=0.005..0.005 rows=0 loops=1)

61. 0.000 0.004 ↓ 0.0 0 1

Nested Loop (cost=0.44..20.37 rows=1 width=8) (actual time=0.004..0.004 rows=0 loops=1)

62. 0.004 0.004 ↓ 0.0 0 1

Index Only Scan using rif_orari_sport_giorni_pkey on rif_orari_sport_giorni orari_1 (cost=0.15..12.05 rows=1 width=8) (actual time=0.004..0.004 rows=0 loops=1)

  • Index Cond: ((id_sede > 0) AND (id_sportello = 0) AND (mese_giorno_da <= '1008'::text) AND (mese_giorno_a >= '1008'::text) AND (day_of_week = '2'::text) AND (dalle_ore <= '123000'::bpchar) AND (alle_ore >= '090000'::bpchar))
  • Heap Fetches: 0
63. 0.000 0.000 ↓ 0.0 0

Index Scan using rif_soggetti_sedi_id on rif_soggetti_sedi sedi_1 (cost=0.29..8.31 rows=1 width=8) (never executed)

  • Index Cond: (id_sede = orari_1.id_sede)
  • Filter: (flg_att_gest_orari_ap = '1'::bpchar)
64. 28.094 28.094 ↑ 1.0 21,879 1

Seq Scan on rif_soggetti_sedi sedi2 (cost=0.00..1,490.20 rows=21,880 width=8) (actual time=0.007..28.094 rows=21,879 loops=1)

  • Filter: ((id_sede > 0) AND (flg_att_gest_orari_ap = '0'::bpchar))
  • Rows Removed by Filter: 1
65. 11.424 11.424 ↑ 1.0 1 816

Index Scan using rif_soggetti_sedi_id on rif_soggetti_sedi sedi (cost=0.29..0.96 rows=1 width=80) (actual time=0.013..0.014 rows=1 loops=816)

  • Index Cond: (id_sede = punt.id_sede_propr)
66. 1.623 1.632 ↑ 1.0 4 816

Materialize (cost=0.00..1.06 rows=4 width=524) (actual time=0.000..0.002 rows=4 loops=816)

67. 0.009 0.009 ↑ 1.0 4 1

Seq Scan on rif_ricorrenze ricorr (cost=0.00..1.04 rows=4 width=524) (actual time=0.005..0.009 rows=4 loops=1)

68. 4.896 4.896 ↑ 1.0 1 816

Index Scan using rif_tipi_microraccolta_id on rif_tipi_microraccolta tipo_mr (cost=0.14..0.16 rows=1 width=146) (actual time=0.005..0.006 rows=1 loops=816)

  • Index Cond: (id = comp.id_tipo_microraccolta)
69. 9.792 9.792 ↑ 1.0 1 816

Index Scan using rif_classe_omogenea_key_classe_omogenea on rif_classe_omogenea cl_om (cost=0.14..0.16 rows=1 width=540) (actual time=0.010..0.012 rows=1 loops=816)

  • Index Cond: ((codice_classe_omogenea)::text = (comp.cl_omogenea)::text)
70. 1.627 1.632 ↑ 1.0 2 816

Materialize (cost=0.00..1.03 rows=2 width=146) (actual time=0.001..0.002 rows=2 loops=816)

71. 0.005 0.005 ↑ 1.0 2 1

Seq Scan on rif_tipologia_componenti tipo_c (cost=0.00..1.02 rows=2 width=146) (actual time=0.003..0.005 rows=2 loops=1)

72. 0.012 0.017 ↓ 0.0 0 1

Sort (cost=8.17..8.18 rows=1 width=8) (actual time=0.017..0.017 rows=0 loops=1)

  • Sort Key: tmp_prog.id_organizz NULLS FIRST
  • Sort Method: quicksort Memory: 25kB
73. 0.005 0.005 ↓ 0.0 0 1

Index Scan using rif_tmp_progr_microracc_rag_soc_priorita on rif_tmp_progr_microracc tmp_prog (cost=0.14..8.16 rows=1 width=8) (actual time=0.005..0.005 rows=0 loops=1)

  • Index Cond: ((tmp_flg_vista_selez = '1'::bpchar) AND ((id_sessione)::text = 'qpkpqpmgdkl611pgd0if0qvggh'::text))
74. 0.008 0.014 ↓ 0.0 0 1

Sort (cost=16.43..16.43 rows=1 width=8) (actual time=0.014..0.014 rows=0 loops=1)

  • Sort Key: var.id_organizz NULLS FIRST
  • Sort Method: quicksort Memory: 25kB
75. 0.001 0.006 ↓ 0.0 0 1

Bitmap Heap Scan on rif_variaz_organizz var (cost=5.58..16.42 rows=1 width=8) (actual time=0.006..0.006 rows=0 loops=1)

  • Recheck Cond: ((data_ini <= '20191008'::bpchar) AND (data_fine >= '20191008'::bpchar))
  • Filter: ((tipo_variaz)::text = 'SOSP'::text)
76. 0.005 0.005 ↓ 0.0 0 1

Bitmap Index Scan on rif_variaz_organizz_ord_display (cost=0.00..5.58 rows=48 width=0) (actual time=0.005..0.005 rows=0 loops=1)

  • Index Cond: ((data_ini <= '20191008'::bpchar) AND (data_fine >= '20191008'::bpchar))
77. 0.000 0.000 ↓ 0.0 0 816

Materialize (cost=0.57..132.17 rows=29 width=8) (actual time=0.000..0.000 rows=0 loops=816)

78. 0.001 0.011 ↓ 0.0 0 1

Nested Loop (cost=0.57..132.02 rows=29 width=8) (actual time=0.011..0.011 rows=0 loops=1)

79. 0.010 0.010 ↓ 0.0 0 1

Index Only Scan using rif_schede_lav_data_exe_prev_desc on rif_schede_lav sl (cost=0.28..23.08 rows=9 width=8) (actual time=0.010..0.010 rows=0 loops=1)

  • Index Cond: (data_esecuzione_prevista = '20191008'::bpchar)
  • Heap Fetches: 0
80. 0.000 0.000 ↓ 0.0 0

Index Scan using rif_servizi_schede_lav_progr_esecuzione on rif_servizi_schede_lav sv (cost=0.29..12.07 rows=3 width=16) (never executed)

  • Index Cond: (id_scheda_lav = sl.id)
  • Filter: (flg_segn_srv_non_effett = '0'::bpchar)
81.          

SubPlan (forNested Loop Anti Join)

82. 2.448 7,510.464 ↑ 1.0 1 816

Result (cost=1,065.24..1,065.25 rows=1 width=8) (actual time=9.204..9.204 rows=1 loops=816)

83.          

Initplan (forResult)

84. 1.632 7,508.016 ↓ 0.0 0 816

GroupAggregate (cost=0.28..1,065.24 rows=1 width=16) (actual time=9.201..9.201 rows=0 loops=816)

  • Group Key: sv_1.id_organizzaz
85. 3.242 7,506.384 ↓ 0.0 0 816

Nested Loop (cost=0.28..1,065.22 rows=1 width=8) (actual time=9.194..9.199 rows=0 loops=816)

86. 7,503.120 7,503.120 ↓ 0.0 0 816

Seq Scan on rif_servizi_schede_lav sv_1 (cost=0.00..1,056.91 rows=1 width=16) (actual time=9.190..9.195 rows=0 loops=816)

  • Filter: ((flg_segn_srv_non_effett = '0'::bpchar) AND (flg_eseguito = '1'::bpchar) AND (id_organizzaz = org.id))
  • Rows Removed by Filter: 8797
87. 0.022 0.022 ↑ 1.0 1 2

Index Scan using rif_schede_lav_id on rif_schede_lav sl_1 (cost=0.28..8.30 rows=1 width=8) (actual time=0.010..0.011 rows=1 loops=2)

  • Index Cond: (id = sv_1.id_scheda_lav)
  • Filter: ((data_esecuzione >= '20190101'::bpchar) AND (data_esecuzione <= '20191231'::bpchar))
88. 2.448 1,617.312 ↑ 1.0 1 816

Result (cost=175.31..175.32 rows=1 width=8) (actual time=1.982..1.982 rows=1 loops=816)

89.          

Initplan (forResult)

90. 3.264 1,614.864 ↓ 0.0 0 816

GroupAggregate (cost=0.29..175.31 rows=1 width=16) (actual time=1.979..1.979 rows=0 loops=816)

  • Group Key: sv_2.id_organizzaz
91. 1.632 1,611.600 ↓ 0.0 0 816

Nested Loop (cost=0.29..175.29 rows=1 width=8) (actual time=1.975..1.975 rows=0 loops=816)

92. 1,609.968 1,609.968 ↓ 0.0 0 816

Seq Scan on rif_schede_lav sl_2 (cost=0.00..163.19 rows=1 width=8) (actual time=1.973..1.973 rows=0 loops=816)

  • Filter: ((data_esecuzione >= '20191001'::bpchar) AND (data_esecuzione <= '20191031'::bpchar))
  • Rows Removed by Filter: 2618
93. 0.000 0.000 ↓ 0.0 0

Index Scan using rif_servizi_schede_lav_progr_esecuzione on rif_servizi_schede_lav sv_2 (cost=0.29..12.09 rows=1 width=16) (never executed)

  • Index Cond: (id_scheda_lav = sl_2.id)
  • Filter: ((flg_segn_srv_non_effett = '0'::bpchar) AND (flg_eseguito = '1'::bpchar) AND (id_organizzaz = org.id))
94. 2.448 1,491.648 ↑ 1.0 1 816

Result (cost=175.31..175.32 rows=1 width=8) (actual time=1.828..1.828 rows=1 loops=816)

95.          

Initplan (forResult)

96. 2.448 1,489.200 ↓ 0.0 0 816

GroupAggregate (cost=0.29..175.31 rows=1 width=16) (actual time=1.825..1.825 rows=0 loops=816)

  • Group Key: sv_3.id_organizzaz
97. 0.816 1,486.752 ↓ 0.0 0 816

Nested Loop (cost=0.29..175.29 rows=1 width=8) (actual time=1.822..1.822 rows=0 loops=816)

98. 1,485.936 1,485.936 ↓ 0.0 0 816

Seq Scan on rif_schede_lav sl_3 (cost=0.00..163.19 rows=1 width=8) (actual time=1.821..1.821 rows=0 loops=816)

  • Filter: ((data_esecuzione >= '20191007'::bpchar) AND (data_esecuzione <= '20191013'::bpchar))
  • Rows Removed by Filter: 2618
99. 0.000 0.000 ↓ 0.0 0

Index Scan using rif_servizi_schede_lav_progr_esecuzione on rif_servizi_schede_lav sv_3 (cost=0.29..12.09 rows=1 width=16) (never executed)

  • Index Cond: (id_scheda_lav = sl_3.id)
  • Filter: ((flg_segn_srv_non_effett = '0'::bpchar) AND (flg_eseguito = '1'::bpchar) AND (id_organizzaz = org.id))
100. 1.632 5,501.472 ↓ 0.0 0 816

Limit (cost=0.28..1,043.09 rows=1 width=9) (actual time=6.742..6.742 rows=0 loops=816)

101. 2.432 5,499.840 ↓ 0.0 0 816

Nested Loop (cost=0.28..1,043.09 rows=1 width=9) (actual time=6.740..6.740 rows=0 loops=816)

102. 5,497.392 5,497.392 ↓ 0.0 0 816

Seq Scan on rif_servizi_schede_lav svd (cost=0.00..1,034.78 rows=1 width=8) (actual time=6.737..6.737 rows=0 loops=816)

  • Filter: ((id_organizzaz = org.id) AND (flg_eseguito = '1'::bpchar))
  • Rows Removed by Filter: 8789
103. 0.016 0.016 ↑ 1.0 1 2

Index Scan using rif_schede_lav_id on rif_schede_lav sld (cost=0.28..8.30 rows=1 width=17) (actual time=0.008..0.008 rows=1 loops=2)

  • Index Cond: (id = svd.id_scheda_lav)
  • Filter: (flg_eseguito = '1'::bpchar)
104. 6.528 40.800 ↓ 0.0 0 816

Limit (cost=2.83..2.84 rows=1 width=24) (actual time=0.050..0.050 rows=0 loops=816)

105. 13.872 34.272 ↓ 0.0 0 816

Sort (cost=2.83..2.84 rows=1 width=24) (actual time=0.042..0.042 rows=0 loops=816)

  • Sort Key: note_prg_2.date_upd DESC, note_prg_2.time_upd DESC
  • Sort Method: quicksort Memory: 25kB
106. 20.400 20.400 ↓ 0.0 0 816

Seq Scan on rif_note_progr_micro note_prg_2 (cost=0.00..2.83 rows=1 width=24) (actual time=0.025..0.025 rows=0 loops=816)

  • Filter: (id_organizz = org.id)
  • Rows Removed by Filter: 66
107. 0.194 144.477 ↓ 12.3 172 1

Subquery Scan on *SELECT* 2 (cost=4,569.36..5,471.80 rows=14 width=1,568) (actual time=102.583..144.477 rows=172 loops=1)

108. 0.368 144.283 ↓ 12.3 172 1

Hash Anti Join (cost=4,569.36..5,471.49 rows=14 width=1,492) (actual time=102.579..144.283 rows=172 loops=1)

  • Hash Cond: (serv2.id = tmp_prog_1.id_rich_servizio)
109. 0.485 141.847 ↓ 12.3 172 1

Nested Loop Anti Join (cost=4,561.18..5,418.79 rows=14 width=1,211) (actual time=102.530..141.847 rows=172 loops=1)

110. 0.391 126.949 ↓ 6.3 497 1

Hash Left Join (cost=4,559.74..5,129.32 rows=79 width=1,211) (actual time=102.307..126.949 rows=497 loops=1)

  • Hash Cond: (comp_1.id_tipo_comp = tipo_c_1.id)
111. 3.457 126.547 ↓ 6.3 497 1

Hash Left Join (cost=4,558.70..5,127.19 rows=79 width=1,073) (actual time=102.285..126.547 rows=497 loops=1)

  • Hash Cond: ((comp_1.cl_omogenea)::text = (cl_om_1.codice_classe_omogenea)::text)
112. 0.420 123.045 ↓ 6.3 497 1

Hash Left Join (cost=4,556.62..5,124.02 rows=79 width=557) (actual time=102.228..123.045 rows=497 loops=1)

  • Hash Cond: (comp_1.id_tipo_microraccolta = tipo_mr_1.id)
113. 0.427 122.601 ↓ 6.3 497 1

Hash Join (cost=4,555.12..5,121.44 rows=79 width=419) (actual time=102.186..122.601 rows=497 loops=1)

  • Hash Cond: (serv2.id_causale = caus.id)
114. 9.294 122.102 ↑ 6.7 497 1

Hash Join (cost=4,552.58..5,105.61 rows=3,335 width=427) (actual time=102.098..122.102 rows=497 loops=1)

  • Hash Cond: (orari_2.id_sede = punt_1.id_sede_propr)
115. 23.844 70.455 ↑ 1.0 21,879 1

HashAggregate (cost=1,784.09..2,002.89 rows=21,881 width=8) (actual time=59.595..70.455 rows=21,879 loops=1)

  • Group Key: orari_2.id_sede
116. 12.499 46.611 ↑ 1.0 21,879 1

Append (cost=0.44..1,729.38 rows=21,881 width=8) (actual time=0.019..46.611 rows=21,879 loops=1)

117. 0.001 0.007 ↓ 0.0 0 1

Unique (cost=0.44..20.37 rows=1 width=8) (actual time=0.007..0.007 rows=0 loops=1)

118. 0.001 0.006 ↓ 0.0 0 1

Nested Loop (cost=0.44..20.37 rows=1 width=8) (actual time=0.006..0.006 rows=0 loops=1)

119. 0.005 0.005 ↓ 0.0 0 1

Index Only Scan using rif_orari_sport_giorni_pkey on rif_orari_sport_giorni orari_2 (cost=0.15..12.05 rows=1 width=8) (actual time=0.005..0.005 rows=0 loops=1)

  • Index Cond: ((id_sede > 0) AND (id_sportello = 0) AND (mese_giorno_da <= '1008'::text) AND (mese_giorno_a >= '1008'::text) AND (day_of_week = '2'::text) AND (dalle_ore <= '123000'::bpchar) AND (alle_ore >= '090000'::bpchar))
  • Heap Fetches: 0
120. 0.000 0.000 ↓ 0.0 0

Index Scan using rif_soggetti_sedi_id on rif_soggetti_sedi sedi_3 (cost=0.29..8.31 rows=1 width=8) (never executed)

  • Index Cond: (id_sede = orari_2.id_sede)
  • Filter: (flg_att_gest_orari_ap = '1'::bpchar)
121. 34.105 34.105 ↑ 1.0 21,879 1

Seq Scan on rif_soggetti_sedi sedi2_1 (cost=0.00..1,490.20 rows=21,880 width=8) (actual time=0.010..34.105 rows=21,879 loops=1)

  • Filter: ((id_sede > 0) AND (flg_att_gest_orari_ap = '0'::bpchar))
  • Rows Removed by Filter: 1
122. 0.762 42.353 ↑ 2.3 497 1

Hash (cost=2,754.37..2,754.37 rows=1,130 width=427) (actual time=42.353..42.353 rows=497 loops=1)

  • Buckets: 2048 Batches: 1 Memory Usage: 248kB
123. 0.350 41.591 ↑ 2.3 497 1

Hash Left Join (cost=1,247.57..2,754.37 rows=1,130 width=427) (actual time=30.934..41.591 rows=497 loops=1)

  • Hash Cond: (punt_1.id_sede_propr = orari_apert_1.id_sede)
124. 0.407 41.218 ↑ 2.3 497 1

Hash Left Join (cost=1,228.98..2,731.53 rows=1,130 width=371) (actual time=30.891..41.218 rows=497 loops=1)

  • Hash Cond: ((comp_1.cod_rifiuto)::text = (rif_1.cod_rifiuto)::text)
125. 0.541 40.644 ↑ 2.3 497 1

Nested Loop Left Join (cost=1,218.77..2,705.78 rows=1,130 width=314) (actual time=30.708..40.644 rows=497 loops=1)

126. 5.544 38.612 ↑ 2.3 497 1

Hash Join (cost=1,218.48..1,607.22 rows=1,130 width=242) (actual time=30.693..38.612 rows=497 loops=1)

  • Hash Cond: (punt_1.id = comp_1.id_punto_raccolta)
127. 2.402 2.402 ↑ 1.0 7,450 1

Seq Scan on rif_punti_raccolta_attr punt_1 (cost=0.00..349.50 rows=7,450 width=103) (actual time=0.007..2.402 rows=7,450 loops=1)

128. 0.356 30.666 ↑ 2.3 497 1

Hash (cost=1,204.36..1,204.36 rows=1,130 width=147) (actual time=30.666..30.666 rows=497 loops=1)

  • Buckets: 2048 Batches: 1 Memory Usage: 112kB
129. 0.490 30.310 ↑ 2.3 497 1

Hash Join (cost=1,101.12..1,204.36 rows=1,130 width=147) (actual time=24.670..30.310 rows=497 loops=1)

  • Hash Cond: (serv_comp.id_componente = comp_1.id)
130. 4.216 6.889 ↑ 2.3 497 1

Hash Join (cost=302.88..390.57 rows=1,133 width=105) (actual time=1.652..6.889 rows=497 loops=1)

  • Hash Cond: (serv_comp.id_rich_servizio = serv2.id)
131. 1.048 1.048 ↓ 1.0 3,595 1

Seq Scan on rif_rich_serv_componenti serv_comp (cost=0.00..62.90 rows=3,590 width=16) (actual time=0.008..1.048 rows=3,595 loops=1)

132. 0.311 1.625 ↑ 2.2 500 1

Hash (cost=288.92..288.92 rows=1,117 width=97) (actual time=1.625..1.625 rows=500 loops=1)

  • Buckets: 2048 Batches: 1 Memory Usage: 80kB
133. 1.314 1.314 ↑ 2.2 500 1

Seq Scan on rif_richieste_servizi serv2 (cost=0.00..288.92 rows=1,117 width=97) (actual time=0.010..1.314 rows=500 loops=1)

  • Filter: (((stato)::text <> 'X'::text) AND ((stato)::text <> 'C'::text) AND ((stato)::text <> 'S'::text))
  • Rows Removed by Filter: 3025
134. 7.508 22.931 ↑ 1.0 14,577 1

Hash (cost=615.84..615.84 rows=14,592 width=50) (actual time=22.931..22.931 rows=14,577 loops=1)

  • Buckets: 16384 Batches: 1 Memory Usage: 1495kB
135. 15.423 15.423 ↑ 1.0 14,577 1

Seq Scan on rif_punti_raccolta_comp comp_1 (cost=0.00..615.84 rows=14,592 width=50) (actual time=0.008..15.423 rows=14,577 loops=1)

  • Filter: (id_tipo_microraccolta > 0)
  • Rows Removed by Filter: 50
136. 1.491 1.491 ↑ 1.0 1 497

Index Scan using rif_soggetti_sedi_id on rif_soggetti_sedi sedi_2 (cost=0.29..0.96 rows=1 width=80) (actual time=0.002..0.003 rows=1 loops=497)

  • Index Cond: (id_sede = punt_1.id_sede_propr)
137. 0.090 0.167 ↑ 1.0 187 1

Hash (cost=7.87..7.87 rows=187 width=65) (actual time=0.167..0.167 rows=187 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 26kB
138. 0.077 0.077 ↑ 1.0 187 1

Seq Scan on rif_anagrafica_rifiuti rif_1 (cost=0.00..7.87 rows=187 width=65) (actual time=0.008..0.077 rows=187 loops=1)

139. 0.001 0.023 ↓ 0.0 0 1

Hash (cost=18.59..18.59 rows=1 width=64) (actual time=0.023..0.023 rows=0 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 8kB
140. 0.002 0.022 ↓ 0.0 0 1

Subquery Scan on orari_apert_1 (cost=18.57..18.59 rows=1 width=64) (actual time=0.022..0.022 rows=0 loops=1)

141. 0.016 0.020 ↓ 0.0 0 1

Sort (cost=18.57..18.57 rows=1 width=128) (actual time=0.020..0.020 rows=0 loops=1)

  • Sort Key: orari_3.mese_giorno_da, orari_3.mese_giorno_a, orari_3.dalle_ore, orari_3.alle_ore
  • Sort Method: quicksort Memory: 25kB
142. 0.004 0.004 ↓ 0.0 0 1

Index Only Scan using rif_orari_sport_giorni_id on rif_orari_sport_giorni orari_3 (cost=0.15..18.56 rows=1 width=128) (actual time=0.004..0.004 rows=0 loops=1)

  • Index Cond: ((id_sportello = '0'::bigint) AND (mese_giorno_da <= '1008'::text) AND (mese_giorno_a >= '1008'::text) AND (day_of_week = '2'::text) AND (dalle_ore < '123000'::bpchar) AND (alle_ore > '090000'::bpchar))
  • Heap Fetches: 0
143. 0.027 0.072 ↓ 39.0 39 1

Hash (cost=2.52..2.52 rows=1 width=8) (actual time=0.072..0.072 rows=39 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 10kB
144. 0.045 0.045 ↓ 39.0 39 1

Seq Scan on rif_causali_rich_serv caus (cost=0.00..2.52 rows=1 width=8) (actual time=0.012..0.045 rows=39 loops=1)

  • Filter: (flg_rich_microraccolta = '1'::bpchar)
  • Rows Removed by Filter: 3
145. 0.015 0.024 ↑ 1.0 22 1

Hash (cost=1.22..1.22 rows=22 width=146) (actual time=0.024..0.024 rows=22 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 10kB
146. 0.009 0.009 ↑ 1.0 22 1

Seq Scan on rif_tipi_microraccolta tipo_mr_1 (cost=0.00..1.22 rows=22 width=146) (actual time=0.006..0.009 rows=22 loops=1)

147. 0.024 0.045 ↑ 1.0 48 1

Hash (cost=1.48..1.48 rows=48 width=540) (actual time=0.045..0.045 rows=48 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 11kB
148. 0.021 0.021 ↑ 1.0 48 1

Seq Scan on rif_classe_omogenea cl_om_1 (cost=0.00..1.48 rows=48 width=540) (actual time=0.007..0.021 rows=48 loops=1)

149. 0.008 0.011 ↑ 1.0 2 1

Hash (cost=1.02..1.02 rows=2 width=146) (actual time=0.011..0.011 rows=2 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
150. 0.003 0.003 ↑ 1.0 2 1

Seq Scan on rif_tipologia_componenti tipo_c_1 (cost=0.00..1.02 rows=2 width=146) (actual time=0.003..0.003 rows=2 loops=1)

151. 0.516 14.413 ↑ 1.0 1 497

Nested Loop (cost=1.44..3.65 rows=1 width=16) (actual time=0.029..0.029 rows=1 loops=497)

152. 1.869 12.922 ↑ 1.0 1 497

Hash Join (cost=1.16..3.28 rows=1 width=24) (actual time=0.026..0.026 rows=1 loops=497)

  • Hash Cond: (srv1_check.id_trip_work = works1.id)
153. 0.749 2.604 ↑ 3.0 1 434

Nested Loop (cost=0.57..2.67 rows=3 width=24) (actual time=0.006..0.006 rows=1 loops=434)

154. 0.868 0.868 ↑ 2.0 1 434

Index Scan using rif_schede_lav_soggetti_speedup_richserv1 on rif_schede_lav_soggetti sogg1_check (cost=0.28..0.75 rows=2 width=16) (actual time=0.002..0.002 rows=1 loops=434)

  • Index Cond: (id_richiesta_servizio = serv2.id)
155. 0.987 0.987 ↑ 1.0 1 329

Index Scan using rif_servizi_schede_lav_speedup_sogg_serv_non_effett on rif_servizi_schede_lav srv1_check (cost=0.29..0.95 rows=1 width=24) (actual time=0.003..0.003 rows=1 loops=329)

  • Index Cond: ((id_sogg_sch_lav = sogg1_check.id) AND (flg_segn_srv_non_effett = '0'::bpchar))
156. 1.491 8.449 ↓ 3.5 7 497

Hash (cost=0.57..0.57 rows=2 width=16) (actual time=0.017..0.017 rows=7 loops=497)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
157. 6.958 6.958 ↓ 3.5 7 497

Index Scan using rif_trips_works_speedup_id_obj on rif_trips_works works1 (cost=0.28..0.57 rows=2 width=16) (actual time=0.003..0.014 rows=7 loops=497)

  • Index Cond: ((id_object = serv_comp.id_componente) AND ((object_type)::text = 'COMP_PRACC'::text))
158. 0.975 0.975 ↑ 1.0 1 325

Index Scan using rif_schede_lav_id on rif_schede_lav sl1_check (cost=0.28..0.36 rows=1 width=8) (actual time=0.003..0.003 rows=1 loops=325)

  • Index Cond: (id = srv1_check.id_scheda_lav)
  • Filter: ((tipo_scheda)::text = 'M'::text)
159. 0.001 0.004 ↓ 0.0 0 1

Hash (cost=8.16..8.16 rows=1 width=8) (actual time=0.004..0.004 rows=0 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 8kB
160. 0.003 0.003 ↓ 0.0 0 1

Index Scan using rif_tmp_progr_microracc_rag_soc_priorita on rif_tmp_progr_microracc tmp_prog_1 (cost=0.14..8.16 rows=1 width=8) (actual time=0.003..0.003 rows=0 loops=1)

  • Index Cond: ((tmp_flg_vista_selez = '1'::bpchar) AND ((id_sessione)::text = 'qpkpqpmgdkl611pgd0if0qvggh'::text))
161.          

SubPlan (forHash Anti Join)

162. 0.172 2.064 ↓ 0.0 0 172

Limit (cost=3.16..3.16 rows=1 width=24) (actual time=0.012..0.012 rows=0 loops=172)

163. 0.516 1.892 ↓ 0.0 0 172

Sort (cost=3.16..3.32 rows=66 width=24) (actual time=0.011..0.011 rows=0 loops=172)

  • Sort Key: note_prg_1.date_upd DESC, note_prg_1.time_upd DESC
  • Sort Method: quicksort Memory: 25kB
164. 1.376 1.376 ↓ 0.0 0 172

Seq Scan on rif_note_progr_micro note_prg_1 (cost=0.00..2.83 rows=66 width=24) (actual time=0.008..0.008 rows=0 loops=172)

  • Filter: (id_rich_serv = serv2.id)
  • Rows Removed by Filter: 66
165. 0.046 88.882 ↓ 10.0 20 1

Subquery Scan on *SELECT* 3 (cost=2,181.19..2,746.37 rows=2 width=2,955) (actual time=70.520..88.882 rows=20 loops=1)

166. 0.282 88.836 ↓ 10.0 20 1

Nested Loop Anti Join (cost=2,181.19..2,746.29 rows=2 width=3,521) (actual time=70.509..88.836 rows=20 loops=1)

167. 8.897 87.930 ↓ 2.2 182 1

Hash Join (cost=2,180.91..2,701.47 rows=84 width=233) (actual time=69.019..87.930 rows=182 loops=1)

  • Hash Cond: (orari_4.id_sede = serv3.id_sede)
168. 26.234 69.832 ↑ 1.0 21,879 1

HashAggregate (cost=1,784.09..2,002.89 rows=21,881 width=8) (actual time=59.578..69.832 rows=21,879 loops=1)

  • Group Key: orari_4.id_sede
169. 15.426 43.598 ↑ 1.0 21,879 1

Append (cost=0.44..1,729.38 rows=21,881 width=8) (actual time=0.016..43.598 rows=21,879 loops=1)

170. 0.000 0.006 ↓ 0.0 0 1

Unique (cost=0.44..20.37 rows=1 width=8) (actual time=0.006..0.006 rows=0 loops=1)

171. 0.002 0.006 ↓ 0.0 0 1

Nested Loop (cost=0.44..20.37 rows=1 width=8) (actual time=0.006..0.006 rows=0 loops=1)

172. 0.004 0.004 ↓ 0.0 0 1

Index Only Scan using rif_orari_sport_giorni_pkey on rif_orari_sport_giorni orari_4 (cost=0.15..12.05 rows=1 width=8) (actual time=0.004..0.004 rows=0 loops=1)

  • Index Cond: ((id_sede > 0) AND (id_sportello = 0) AND (mese_giorno_da <= '1008'::text) AND (mese_giorno_a >= '1008'::text) AND (day_of_week = '2'::text) AND (dalle_ore <= '123000'::bpchar) AND (alle_ore >= '090000'::bpchar))
  • Heap Fetches: 0
173. 0.000 0.000 ↓ 0.0 0

Index Scan using rif_soggetti_sedi_id on rif_soggetti_sedi sedi_5 (cost=0.29..8.31 rows=1 width=8) (never executed)

  • Index Cond: (id_sede = orari_4.id_sede)
  • Filter: (flg_att_gest_orari_ap = '1'::bpchar)
174. 28.166 28.166 ↑ 1.0 21,879 1

Seq Scan on rif_soggetti_sedi sedi2_2 (cost=0.00..1,490.20 rows=21,880 width=8) (actual time=0.009..28.166 rows=21,879 loops=1)

  • Filter: ((id_sede > 0) AND (flg_att_gest_orari_ap = '0'::bpchar))
  • Rows Removed by Filter: 1
175. 0.184 9.201 ↓ 60.7 182 1

Hash (cost=396.79..396.79 rows=3 width=233) (actual time=9.201..9.201 rows=182 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 51kB
176. 0.198 9.017 ↓ 60.7 182 1

Nested Loop Anti Join (cost=22.14..396.79 rows=3 width=233) (actual time=0.166..9.017 rows=182 loops=1)

  • Join Filter: (tmp_prog_2.id_rich_servizio = serv3.id)
177. 0.127 8.819 ↓ 60.7 182 1

Hash Left Join (cost=21.99..388.57 rows=3 width=233) (actual time=0.158..8.819 rows=182 loops=1)

  • Hash Cond: (serv3.id_sede = orari_apert_2.id_sede)
178. 0.250 8.672 ↓ 60.7 182 1

Nested Loop Left Join (cost=3.39..369.95 rows=3 width=177) (actual time=0.127..8.672 rows=182 loops=1)

179. 0.534 7.876 ↓ 60.7 182 1

Nested Loop Left Join (cost=3.11..360.23 rows=3 width=105) (actual time=0.120..7.876 rows=182 loops=1)

  • Filter: ((sogg.id IS NULL) OR (srv_schede.id IS NULL) OR (srv_schede.flg_segn_srv_non_effett = '1'::bpchar))
  • Rows Removed by Filter: 325
180. 0.490 6.342 ↓ 11.4 500 1

Nested Loop Left Join (cost=2.82..316.63 rows=44 width=113) (actual time=0.101..6.342 rows=500 loops=1)

181. 0.384 4.858 ↓ 18.4 497 1

Hash Join (cost=2.54..295.91 rows=27 width=105) (actual time=0.095..4.858 rows=497 loops=1)

  • Hash Cond: (serv3.id_causale = caus_1.id)
182. 4.399 4.399 ↑ 2.2 500 1

Seq Scan on rif_richieste_servizi serv3 (cost=0.00..288.92 rows=1,117 width=113) (actual time=0.008..4.399 rows=500 loops=1)

  • Filter: (((stato)::text <> 'X'::text) AND ((stato)::text <> 'C'::text) AND ((stato)::text <> 'S'::text))
  • Rows Removed by Filter: 3025
183. 0.018 0.075 ↓ 39.0 39 1

Hash (cost=2.52..2.52 rows=1 width=8) (actual time=0.075..0.075 rows=39 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 10kB
184. 0.057 0.057 ↓ 39.0 39 1

Seq Scan on rif_causali_rich_serv caus_1 (cost=0.00..2.52 rows=1 width=8) (actual time=0.009..0.057 rows=39 loops=1)

  • Filter: (flg_rich_microraccolta = '1'::bpchar)
  • Rows Removed by Filter: 3
185. 0.994 0.994 ↑ 2.0 1 497

Index Scan using rif_schede_lav_soggetti_speedup_richserv1 on rif_schede_lav_soggetti sogg (cost=0.28..0.75 rows=2 width=16) (actual time=0.002..0.002 rows=1 loops=497)

  • Index Cond: (id_richiesta_servizio = serv3.id)
186. 1.000 1.000 ↑ 2.0 1 500

Index Scan using rif_servizi_schede_lav_speedup_sogg_serv_non_effett on rif_servizi_schede_lav srv_schede (cost=0.29..0.97 rows=2 width=18) (actual time=0.001..0.002 rows=1 loops=500)

  • Index Cond: (id_sogg_sch_lav = sogg.id)
187. 0.546 0.546 ↑ 1.0 1 182

Index Scan using rif_soggetti_sedi_id on rif_soggetti_sedi sedi_4 (cost=0.29..3.23 rows=1 width=80) (actual time=0.003..0.003 rows=1 loops=182)

  • Index Cond: (id_sede = serv3.id_sede)
188. 0.001 0.020 ↓ 0.0 0 1

Hash (cost=18.59..18.59 rows=1 width=64) (actual time=0.020..0.020 rows=0 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 8kB
189. 0.001 0.019 ↓ 0.0 0 1

Subquery Scan on orari_apert_2 (cost=18.57..18.59 rows=1 width=64) (actual time=0.019..0.019 rows=0 loops=1)

190. 0.015 0.018 ↓ 0.0 0 1

Sort (cost=18.57..18.57 rows=1 width=128) (actual time=0.018..0.018 rows=0 loops=1)

  • Sort Key: orari_5.mese_giorno_da, orari_5.mese_giorno_a, orari_5.dalle_ore, orari_5.alle_ore
  • Sort Method: quicksort Memory: 25kB
191. 0.003 0.003 ↓ 0.0 0 1

Index Only Scan using rif_orari_sport_giorni_id on rif_orari_sport_giorni orari_5 (cost=0.15..18.56 rows=1 width=128) (actual time=0.003..0.003 rows=0 loops=1)

  • Index Cond: ((id_sportello = '0'::bigint) AND (mese_giorno_da <= '1008'::text) AND (mese_giorno_a >= '1008'::text) AND (day_of_week = '2'::text) AND (dalle_ore < '123000'::bpchar) AND (alle_ore > '090000'::bpchar))
  • Heap Fetches: 0
192. 0.000 0.000 ↓ 0.0 0 182

Materialize (cost=0.14..8.17 rows=1 width=8) (actual time=0.000..0.000 rows=0 loops=182)

193. 0.003 0.003 ↓ 0.0 0 1

Index Scan using rif_tmp_progr_microracc_rag_soc_priorita on rif_tmp_progr_microracc tmp_prog_2 (cost=0.14..8.16 rows=1 width=8) (actual time=0.003..0.003 rows=0 loops=1)

  • Index Cond: ((tmp_flg_vista_selez = '1'::bpchar) AND ((id_sessione)::text = 'qpkpqpmgdkl611pgd0if0qvggh'::text))
194. 0.364 0.364 ↑ 1.0 1 182

Index Only Scan using rif_rich_serv_componenti_pk on rif_rich_serv_componenti serv_comp2 (cost=0.28..0.45 rows=1 width=8) (actual time=0.002..0.002 rows=1 loops=182)

  • Index Cond: (id_rich_servizio = serv3.id)
  • Heap Fetches: 162
195.          

SubPlan (forNested Loop Anti Join)

196. 0.020 0.260 ↓ 0.0 0 20

Limit (cost=3.16..3.16 rows=1 width=24) (actual time=0.013..0.013 rows=0 loops=20)

197. 0.060 0.240 ↓ 0.0 0 20

Sort (cost=3.16..3.32 rows=66 width=24) (actual time=0.012..0.012 rows=0 loops=20)

  • Sort Key: note_prg.date_upd DESC, note_prg.time_upd DESC
  • Sort Method: quicksort Memory: 25kB
198. 0.180 0.180 ↓ 0.0 0 20

Seq Scan on rif_note_progr_micro note_prg (cost=0.00..2.83 rows=66 width=24) (actual time=0.009..0.009 rows=0 loops=20)

  • Filter: (id_rich_serv = serv3.id)
  • Rows Removed by Filter: 66
Planning time : 40.666 ms
Execution time : 177,533.501 ms