QUERY PLAN Nested Loop Left Join (cost=283253.73..417552.90 rows=1 width=227) Join Filter: (ve_edil_rendite.id_domanda = domande.id_domanda) -> Nested Loop (cost=283222.38..417485.46 rows=1 width=195) -> Nested Loop (cost=283222.38..417470.91 rows=1 width=247) -> Nested Loop (cost=283222.38..417456.36 rows=1 width=235) Join Filter: (edil_veneto.id_tp_superficie = ve_edil_tp_superfici.id_tp_superficie) -> Nested Loop (cost=283222.38..417455.29 rows=1 width=228) -> Nested Loop (cost=283222.38..417440.75 rows=1 width=216) Join Filter: ((r_enti.codice_ente)::text = (r_luoghi.cod_catastale)::text) -> Nested Loop (cost=283222.38..417107.61 rows=1 width=215) -> Nested Loop (cost=283222.38..417093.06 rows=1 width=203) -> Nested Loop (cost=283222.38..417084.75 rows=1 width=186) -> Nested Loop (cost=283222.38..417070.20 rows=1 width=174) -> Nested Loop (cost=283222.38..417057.25 rows=1 width=162) -> Nested Loop (cost=283222.38..417044.33 rows=1 width=150) -> Nested Loop (cost=283222.38..417031.40 rows=1 width=138) -> Nested Loop (cost=283222.38..417016.85 rows=1 width=126) -> Nested Loop (cost=283222.38..416343.12 rows=44 width=114) -> Merge Join (cost=283222.38..384803.94 rows=2431 width=102) Merge Cond: (componenti.id_dichiarazione = domande.id_dichiarazione) -> GroupAggregate (cost=0.00..94032.39 rows=601009 width=12) -> Index Scan using "IDX_1_componenti" on componenti (cost=0.00..76403.45 rows=2023265 width=12) -> Sort (cost=283222.38..283223.41 rows=412 width=102) Sort Key: domande.id_dichiarazione -> Nested Loop (cost=37777.86..283204.48 rows=412 width=102) -> Hash Join (cost=37777.86..281453.46 rows=106 width=90) Hash Cond: (domande.id_ente = r_enti.id_ente) -> Nested Loop (cost=37682.56..281356.58 rows=106 width=67) -> Nested Loop (cost=37682.56..280435.24 rows=109 width=63) -> Nested Loop (cost=37682.56..272346.69 rows=621 width=51) -> Hash Join (cost=37682.56..222416.32 rows=3860 width=39) Hash Cond: (c_elain_2.id_domanda = domande.id_domanda) -> Bitmap Heap Scan on c_elain c_elain_2 (cost=2740.46..185813.04 rows=129806 width=12) Recheck Cond: ((node)::text = 'N_componenti'::text) -> Bitmap Index Scan on "IDX_3_c_elain" (cost=0.00..2708.01 rows=129806 width=0) Index Cond: ((node)::text = 'N_componenti'::text) -> Hash (cost=34542.51..34542.51 rows=31967 width=27) -> Bitmap Heap Scan on domande (cost=600.64..34542.51 rows=31967 width=27) Recheck Cond: (id_servizio = 11002) Filter: (id_ente > 0) -> Bitmap Index Scan on "IDX_7_domande" (cost=0.00..592.65 rows=32038 width=0) Index Cond: (id_servizio = 11002) -> Index Scan using "IDX_1_c_elain" on c_elain c_elain_1 (cost=0.00..12.92 rows=1 width=12) Index Cond: (((c_elain_1.node)::text = 'AffittoISEE'::text) AND (c_elain_1.id_domanda = domande.id_domanda)) -> Index Scan using "IDX_1_c_elain" on c_elain (cost=0.00..13.01 rows=1 width=12) Index Cond: (((c_elain.node)::text = 'VSE'::text) AND (c_elain.id_domanda = domande.id_domanda)) -> Index Scan using pk_doc on doc (cost=0.00..8.44 rows=1 width=4) Index Cond: (doc.id = domande.id_domanda) Filter: (doc.id_tp_stato_doc = 1) -> Hash (cost=64.02..64.02 rows=2502 width=31) -> Seq Scan on r_enti (cost=0.00..64.02 rows=2502 width=31) -> Index Scan using "IDX_2_c_elaout" on c_elaout (cost=0.00..16.47 rows=4 width=12) Index Cond: (c_elaout.id_domanda = domande.id_dichiarazione) Filter: ((c_elaout.node)::text = 'ISEE'::text) -> Index Scan using "IDX_1_c_elain" on c_elain c_elain_3 (cost=0.00..12.96 rows=1 width=12) Index Cond: (((c_elain_3.node)::text = 'Solo_anziani'::text) AND (c_elain_3.id_domanda = domande.id_domanda)) -> Index Scan using "IDX_3_c_elaout" on c_elaout c_elaout_2 (cost=0.00..15.30 rows=1 width=12) Index Cond: (((c_elaout_2.node)::text = 'ise_fsa'::text) AND (c_elaout_2.id_domanda = domande.id_domanda)) -> Index Scan using "IDX_2_c_elaout" on c_elaout c_elaout_3 (cost=0.00..14.54 rows=1 width=12) Index Cond: (c_elaout_3.id_domanda = domande.id_domanda) Filter: ((c_elaout_3.node)::text = 'incidenza'::text) -> Index Scan using "IDX_2_c_elain" on c_elain c_elain_9 (cost=0.00..12.91 rows=1 width=12) Index Cond: (c_elain_9.id_domanda = domande.id_domanda) Filter: ((c_elain_9.node)::text = 'Mesi'::text) -> Index Scan using "IDX_2_c_elain" on c_elain c_elain_8 (cost=0.00..12.91 rows=1 width=12) Index Cond: (c_elain_8.id_domanda = domande.id_domanda) Filter: ((c_elain_8.node)::text = 'Spese'::text) -> Index Scan using "IDX_2_c_elain" on c_elain c_elain_7 (cost=0.00..12.91 rows=3 width=12) Index Cond: (c_elain_7.id_domanda = domande.id_domanda) Filter: ((c_elain_7.node)::text = 'Affitto'::text) -> Index Scan using "IDX_2_c_elaout" on c_elaout c_elaout_1 (cost=0.00..14.54 rows=1 width=12) Index Cond: (c_elaout_1.id_domanda = domande.id_domanda) Filter: ((c_elaout_1.node)::text = 'isee_fsa'::text) -> Index Scan using "IDX_pk_Edil_Veneto" on edil_veneto (cost=0.00..8.29 rows=1 width=17) Index Cond: (edil_veneto.id_domanda = domande.id_domanda) -> Index Scan using "IDX_2_c_elaout" on c_elaout c_elaout_7 (cost=0.00..14.54 rows=1 width=12) Index Cond: (c_elaout_7.id_domanda = domande.id_domanda) Filter: ((c_elaout_7.node)::text = 'contributo_regolare'::text) -> Seq Scan on r_luoghi (cost=0.00..200.84 rows=10584 width=11) -> Index Scan using "IDX_2_c_elaout" on c_elaout c_elaout_6 (cost=0.00..14.54 rows=1 width=12) Index Cond: (c_elaout_6.id_domanda = domande.id_domanda) Filter: ((c_elaout_6.node)::text = 'contributo_sociale'::text) -> Seq Scan on ve_edil_tp_superfici (cost=0.00..1.03 rows=3 width=11) -> Index Scan using "IDX_2_c_elaout" on c_elaout c_elaout_5 (cost=0.00..14.54 rows=1 width=12) Index Cond: (c_elaout_5.id_domanda = domande.id_domanda) Filter: ((c_elaout_5.node)::text = 'contributo'::text) -> Index Scan using "IDX_2_c_elaout" on c_elaout c_elaout_4 (cost=0.00..14.54 rows=1 width=12) Index Cond: (c_elaout_4.id_domanda = domande.id_domanda) Filter: ((c_elaout_4.node)::text = 'esito'::text) -> HashAggregate (cost=31.35..44.24 rows=1031 width=11) -> Seq Scan on ve_edil_rendite (cost=0.00..25.57 rows=1157 width=11)