explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Grjo

Settings
# exclusive inclusive rows x rows loops node
1. 0.750 1,899,604.616 ↓ 4.8 528 1

Unique (cost=662,115.77..662,125.21 rows=111 width=1,680) (actual time=1,899,603.776..1,899,604.616 rows=528 loops=1)

2. 7.822 1,899,603.866 ↓ 4.8 528 1

Sort (cost=662,115.77..662,116.05 rows=111 width=1,680) (actual time=1,899,603.769..1,899,603.866 rows=528 loops=1)

  • Sort Key: ticket.id_bdn, ticket.id_bdn_b11, o.name, o.org_id, ticket.ticketid, ticket.assigned_date, (CASE WHEN (ticket.site_id = 201) THEN 'R201'::text WHEN (ticket.site_id = 202) THEN 'R103'::text WHEN (ticket.site_id = 203) THEN 'R203'::text WHEN (ticket.site_id = 204) THEN 'R106'::text WHEN (ticket.site_id = 205) THEN 'R205'::text WHEN (ticket.site_id = 206) THEN 'R206'::text WHEN (ticket.site_id = 207) THEN 'R207'::text ELSE NULL::text END), asl1.description, o.account_number, o.partita_iva, (CASE WHEN (((nucleo.nucleo_ispettivo)::text ~~* '%forestale% '::text) OR ((nucleo.nucleo_ispettivo_due)::text ~~* '%forestale% '::text) OR ((nucleo.nucleo_ispettivo_tre)::text ~~* '%forestale% '::text) OR ((nucleo.nucleo_ispettivo_quattro)::text ~~* '%forestale% '::text) OR ((nucleo.nucleo_ispettivo_cinque)::text ~~* '%forestale% '::text) OR ((nucleo.nucleo_ispettivo_sei)::text ~~* '%forestale% '::text) OR ((nucleo.nucleo_ispettivo_sette)::text ~~* '%forestale% '::text) OR ((nucleo.nucleo_ispettivo_otto)::text ~~* '%forestale% '::text) OR ((nucleo.nucleo_ispettivo_nove)::text ~~* '%forestale% '::text) OR ((nucleo.nucleo_ispettivo_dieci)::text ~~* '%forestale% '::text)) THEN '002'::text WHEN (((nucleo.nucleo_ispettivo)::text ~~* '%NAS% '::text) OR ((nucleo.nucleo_ispettivo_due)::text ~~* '%NAS% '::text) OR ((nucleo.nucleo_ispettivo_tre)::text ~~* '%NAS% '::text) OR ((nucleo.nucleo_ispettivo_quattro)::text ~~* '%NAS% '::text) OR ((nucleo.nucleo_ispettivo_cinque)::text ~~* '%NAS% '::text) OR ((nucleo.nucleo_ispettivo_sei)::text ~~* '%NAS% '::text) OR ((nucleo.nucleo_ispettivo_sette)::text ~~* '%NAS% '::text) OR ((nucleo.nucleo_ispettivo_otto)::text ~~* '%NAS% '::text) OR ((nucleo.nucleo_ispettivo_nove)::text ~~* '%NAS% '::text) OR ((nucleo.nucleo_ispettivo_dieci)::text ~~* '%NAS% '::text)) THEN '001'::text WHEN (((nucleo.nucleo_ispettivo)::text ~~* '%veterinari% '::text) OR ((nucleo.nucleo_ispettivo_due)::text ~~* '%veterinari% '::text) OR ((nucleo.nucleo_ispettivo_tre)::text ~~* '%veterinari% '::text) OR ((nucleo.nucleo_ispettivo_quattro)::text ~~* '%veterinari% '::text) OR ((nucleo.nucleo_ispettivo_cinque)::text ~~* '%veterinari% '::text) OR ((nucleo.nucleo_ispettivo_sei)::text ~~* '%veterinari% '::text) OR ((nucleo.nucleo_ispettivo_sette)::text ~~* '%veterinari% '::text) OR ((nucleo.nucleo_ispettivo_otto)::text ~~* '%veterinari% '::text) OR ((nucleo.nucleo_ispettivo_nove)::text ~~* '%veterinari% '::text) OR ((nucleo.nucleo_ispettivo_dieci)::text ~~* '%veterinari% '::text)) THEN '003'::text ELSE '003'::text END), (CASE WHEN (ticket.closed IS NULL) THEN 'APERTO'::text WHEN ticket.closed_nolista THEN 'CHIUSO SENZA LISTA PER ASSENZA DI NON CONFORMITA'''::text ELSE 'CHIUSO'::text END), o.cf_detentore, op.tipo_produzione, (CASE WHEN (op.codice_orientamento IS NOT NULL) THEN op.codice_orientamento ELSE ''::text END), ticket.data_estrazione, ticket.data_import, ticket.esito_import, ticket.descrizione_errore, ticket.data_estrazione_b11, ticket.data_import_b11, ticket.esito_import_b11, ticket.descrizione_errore_b11, (CASE WHEN ((ticket.data_estrazione_b11 IS NULL) OR (ticket.data_import_b11 IS NULL) OR ((ticket.data_import_b11 IS NOT NULL) AND (ticket.esito_import_b11 = 'KO'::text))) THEN 'I'::text WHEN ((ticket.modified > ticket.data_estrazione_b11) OR (ticket.data_import_b11 < ticket.data_estrazione_b11)) THEN 'V'::text ELSE NULL::text END), o.specie_allev, (('0'::text || (o.specie_allevamento)::text)), (CASE WHEN ((((o.specie_allev)::text ~~* 'gallus'::text) OR ((o.specie_allev)::text ~~* 'oche'::text) OR ((o.specie_allev)::text ~~* 'fagiani'::text)) AND (o.codice_tipo_allevamento IS NOT NULL)) THEN o.codice_tipo_allevamento ELSE '4'::text END), (CASE WHEN ((ticket.flag_preavviso IS NULL) OR (ticket.flag_preavviso ~~* '-1'::text)) THEN 'N'::text ELSE ticket.flag_preavviso END), ticket.data_preavviso_ba, (CASE WHEN (ist.mod_b11_flag_rilascio_copia OR ((ticket.flag_checklist)::text = 'S'::text)) THEN 'S'::text ELSE 'N'::text END), (CASE WHEN ((SubPlan 1) = 0) THEN 'S'::text ELSE 'N'::text END), lcm.code, lpiani.code
  • Sort Method: quicksort Memory: 334kB
3. 18.534 1,899,596.044 ↓ 4.8 528 1

Group (cost=661,496.23..662,112.00 rows=111 width=1,680) (actual time=1,899,577.201..1,899,596.044 rows=528 loops=1)

  • Group Key: o.org_id, ticket.ticketid, nucleo.nucleo_ispettivo, nucleo.nucleo_ispettivo_due, nucleo.nucleo_ispettivo_tre, nucleo.nucleo_ispettivo_quattro, nucleo.nucleo_ispettivo_cinque, nucleo.nucleo_ispettivo_sei, nucleo.nucleo_ispettivo_sette, nucleo.nucleo_ispettivo_otto, nucleo.nucleo_ispettivo_nove, nucleo.nucleo_ispettivo_dieci, (CASE WHEN (ticket.site_id = 201) THEN 'R201'::text WHEN (ticket.site_id = 202) THEN 'R103'::text WHEN (ticket.site_id = 203) THEN 'R203'::text WHEN (ticket.site_id = 204) THEN 'R106'::text WHEN (ticket.site_id = 205) THEN 'R205'::text WHEN (ticket.site_id = 206) THEN 'R206'::text WHEN (ticket.site_id = 207) THEN 'R207'::text ELSE NULL::text END), asl1.description, (('0'::text || (o.specie_allevamento)::text)), (CASE WHEN (((nucleo.nucleo_ispettivo)::text ~~* '%forestale% '::text) OR ((nucleo.nucleo_ispettivo_due)::text ~~* '%forestale% '::text) OR ((nucleo.nucleo_ispettivo_tre)::text ~~* '%forestale% '::text) OR ((nucleo.nucleo_ispettivo_quattro)::text ~~* '%forestale% '::text) OR ((nucleo.nucleo_ispettivo_cinque)::text ~~* '%forestale% '::text) OR ((nucleo.nucleo_ispettivo_sei)::text ~~* '%forestale% '::text) OR ((nucleo.nucleo_ispettivo_sette)::text ~~* '%forestale% '::text) OR ((nucleo.nucleo_ispettivo_otto)::text ~~* '%forestale% '::text) OR ((nucleo.nucleo_ispettivo_nove)::text ~~* '%forestale% '::text) OR ((nucleo.nucleo_ispettivo_dieci)::text ~~* '%forestale% '::text)) THEN '002'::text WHEN (((nucleo.nucleo_ispettivo)::text ~~* '%NAS% '::text) OR ((nucleo.nucleo_ispettivo_due)::text ~~* '%NAS% '::text) OR ((nucleo.nucleo_ispettivo_tre)::text ~~* '%NAS% '::text) OR ((nucleo.nucleo_ispettivo_quattro)::text ~~* '%NAS% '::text) OR ((nucleo.nucleo_ispettivo_cinque)::text ~~* '%NAS% '::text) OR ((nucleo.nucleo_ispettivo_sei)::text ~~* '%NAS% '::text) OR ((nucleo.nucleo_ispettivo_sette)::text ~~* '%NAS% '::text) OR ((nucleo.nucleo_ispettivo_otto)::text ~~* '%NAS% '::text) OR ((nucleo.nucleo_ispettivo_nove)::text ~~* '%NAS% '::text) OR ((nucleo.nucleo_ispettivo_dieci)::text ~~* '%NAS% '::text)) THEN '001'::text WHEN (((nucleo.nucleo_ispettivo)::text ~~* '%veterinari% '::text) OR ((nucleo.nucleo_ispettivo_due)::text ~~* '%veterinari% '::text) OR ((nucleo.nucleo_ispettivo_tre)::text ~~* '%veterinari% '::text) OR ((nucleo.nucleo_ispettivo_quattro)::text ~~* '%veterinari% '::text) OR ((nucleo.nucleo_ispettivo_cinque)::text ~~* '%veterinari% '::text) OR ((nucleo.nucleo_ispettivo_sei)::text ~~* '%veterinari% '::text) OR ((nucleo.nucleo_ispettivo_sette)::text ~~* '%veterinari% '::text) OR ((nucleo.nucleo_ispettivo_otto)::text ~~* '%veterinari% '::text) OR ((nucleo.nucleo_ispettivo_nove)::text ~~* '%veterinari% '::text) OR ((nucleo.nucleo_ispettivo_dieci)::text ~~* '%veterinari% '::text)) THEN '003'::text ELSE 'n.d.'::text END), (CASE WHEN (ticket.closed IS NULL) THEN 'APERTO'::text WHEN ticket.closed_nolista THEN 'CHIUSO SENZA LISTA PER ASSENZA DI NON CONFORMITA'''::text ELSE 'CHIUSO'::text END), op.tipo_produzione, (CASE WHEN (op.codice_orientamento IS NOT NULL) THEN op.codice_orientamento ELSE ''::text END), (CASE WHEN ((ticket.data_estrazione_b11 IS NULL) OR (ticket.data_import_b11 IS NULL) OR ((ticket.data_import_b11 IS NOT NULL) AND (ticket.esito_import_b11 = 'KO'::text))) THEN 'I'::text WHEN ((ticket.modified > ticket.data_estrazione_b11) OR (ticket.data_import_b11 < ticket.data_estrazione_b11)) THEN 'V'::text ELSE NULL::text END), (CASE WHEN ((ticket.punteggio <= 3) OR (ticket.punteggio IS NULL)) THEN 'S'::text ELSE 'N'::text END), (CASE WHEN ((o.specie_allev)::text ~~* '%suini%'::text) THEN '2'::text WHEN ((o.specie_allev)::text ~~* '%broiler%'::text) THEN '5'::text WHEN ((o.specie_allev)::text ~~* '%gallus%'::text) THEN '1'::text ELSE '4'::text END), 'N'::text, (CASE WHEN (((o.specie_allev)::text ~~* 'gallus'::text) AND (o.codice_tipo_allevamento IS NOT NULL)) THEN o.codice_tipo_allevamento ELSE '4'::text END), (CASE WHEN (ist.mod_b11_flag_rilascio_copia OR ((ticket.flag_checklist)::text = 'S'::text)) THEN 'S'::text ELSE 'N'::text END), (CASE WHEN ((SubPlan 1) = 0) THEN 'S': (...)
4. 94.443 1,899,577.510 ↓ 13.5 1,498 1

Sort (cost=661,496.23..661,496.51 rows=111 width=1,552) (actual time=1,899,577.070..1,899,577.510 rows=1,498 loops=1)

  • Sort Key: o.org_id, ticket.ticketid, nucleo.nucleo_ispettivo, nucleo.nucleo_ispettivo_due, nucleo.nucleo_ispettivo_tre, nucleo.nucleo_ispettivo_quattro, nucleo.nucleo_ispettivo_cinque, nucleo.nucleo_ispettivo_sei, nucleo.nucleo_ispettivo_sette, nucleo.nucleo_ispettivo_otto, nucleo.nucleo_ispettivo_nove, nucleo.nucleo_ispettivo_dieci, (CASE WHEN (ticket.site_id = 201) THEN 'R201'::text WHEN (ticket.site_id = 202) THEN 'R103'::text WHEN (ticket.site_id = 203) THEN 'R203'::text WHEN (ticket.site_id = 204) THEN 'R106'::text WHEN (ticket.site_id = 205) THEN 'R205'::text WHEN (ticket.site_id = 206) THEN 'R206'::text WHEN (ticket.site_id = 207) THEN 'R207'::text ELSE NULL::text END), asl1.description, (('0'::text || (o.specie_allevamento)::text)), (CASE WHEN (((nucleo.nucleo_ispettivo)::text ~~* '%forestale% '::text) OR ((nucleo.nucleo_ispettivo_due)::text ~~* '%forestale% '::text) OR ((nucleo.nucleo_ispettivo_tre)::text ~~* '%forestale% '::text) OR ((nucleo.nucleo_ispettivo_quattro)::text ~~* '%forestale% '::text) OR ((nucleo.nucleo_ispettivo_cinque)::text ~~* '%forestale% '::text) OR ((nucleo.nucleo_ispettivo_sei)::text ~~* '%forestale% '::text) OR ((nucleo.nucleo_ispettivo_sette)::text ~~* '%forestale% '::text) OR ((nucleo.nucleo_ispettivo_otto)::text ~~* '%forestale% '::text) OR ((nucleo.nucleo_ispettivo_nove)::text ~~* '%forestale% '::text) OR ((nucleo.nucleo_ispettivo_dieci)::text ~~* '%forestale% '::text)) THEN '002'::text WHEN (((nucleo.nucleo_ispettivo)::text ~~* '%NAS% '::text) OR ((nucleo.nucleo_ispettivo_due)::text ~~* '%NAS% '::text) OR ((nucleo.nucleo_ispettivo_tre)::text ~~* '%NAS% '::text) OR ((nucleo.nucleo_ispettivo_quattro)::text ~~* '%NAS% '::text) OR ((nucleo.nucleo_ispettivo_cinque)::text ~~* '%NAS% '::text) OR ((nucleo.nucleo_ispettivo_sei)::text ~~* '%NAS% '::text) OR ((nucleo.nucleo_ispettivo_sette)::text ~~* '%NAS% '::text) OR ((nucleo.nucleo_ispettivo_otto)::text ~~* '%NAS% '::text) OR ((nucleo.nucleo_ispettivo_nove)::text ~~* '%NAS% '::text) OR ((nucleo.nucleo_ispettivo_dieci)::text ~~* '%NAS% '::text)) THEN '001'::text WHEN (((nucleo.nucleo_ispettivo)::text ~~* '%veterinari% '::text) OR ((nucleo.nucleo_ispettivo_due)::text ~~* '%veterinari% '::text) OR ((nucleo.nucleo_ispettivo_tre)::text ~~* '%veterinari% '::text) OR ((nucleo.nucleo_ispettivo_quattro)::text ~~* '%veterinari% '::text) OR ((nucleo.nucleo_ispettivo_cinque)::text ~~* '%veterinari% '::text) OR ((nucleo.nucleo_ispettivo_sei)::text ~~* '%veterinari% '::text) OR ((nucleo.nucleo_ispettivo_sette)::text ~~* '%veterinari% '::text) OR ((nucleo.nucleo_ispettivo_otto)::text ~~* '%veterinari% '::text) OR ((nucleo.nucleo_ispettivo_nove)::text ~~* '%veterinari% '::text) OR ((nucleo.nucleo_ispettivo_dieci)::text ~~* '%veterinari% '::text)) THEN '003'::text ELSE 'n.d.'::text END), (CASE WHEN (ticket.closed IS NULL) THEN 'APERTO'::text WHEN ticket.closed_nolista THEN 'CHIUSO SENZA LISTA PER ASSENZA DI NON CONFORMITA'''::text ELSE 'CHIUSO'::text END), op.tipo_produzione, (CASE WHEN (op.codice_orientamento IS NOT NULL) THEN op.codice_orientamento ELSE ''::text END), (CASE WHEN ((ticket.data_estrazione_b11 IS NULL) OR (ticket.data_import_b11 IS NULL) OR ((ticket.data_import_b11 IS NOT NULL) AND (ticket.esito_import_b11 = 'KO'::text))) THEN 'I'::text WHEN ((ticket.modified > ticket.data_estrazione_b11) OR (ticket.data_import_b11 < ticket.data_estrazione_b11)) THEN 'V'::text ELSE NULL::text END), (CASE WHEN ((ticket.punteggio <= 3) OR (ticket.punteggio IS NULL)) THEN 'S'::text ELSE 'N'::text END), (CASE WHEN ((o.specie_allev)::text ~~* '%suini%'::text) THEN '2'::text WHEN ((o.specie_allev)::text ~~* '%broiler%'::text) THEN '5'::text WHEN ((o.specie_allev)::text ~~* '%gallus%'::text) THEN '1'::text ELSE '4'::text END), (CASE WHEN (((o.specie_allev)::text ~~* 'gallus'::text) AND (o.codice_tipo_allevamento IS NOT NULL)) THEN o.codice_tipo_allevamento ELSE '4'::text END), (CASE WHEN (ist.mod_b11_flag_rilascio_copia OR ((ticket.flag_checklist)::text = 'S'::text)) THEN 'S'::text ELSE 'N'::text END), (CASE WHEN ((SubPlan 1) = 0) THEN 'S'::text (...)
  • Sort Method: quicksort Memory: 994kB
5. 76.901 1,899,483.067 ↓ 13.5 1,498 1

Hash Left Join (cost=207,582.41..661,492.46 rows=111 width=1,552) (actual time=97,615.454..1,899,483.067 rows=1,498 loops=1)

  • Hash Cond: ((o.specie_allev)::text = (specie.description)::text)
6. 8.656 1,898,883.320 ↓ 13.5 1,498 1

Hash Left Join (cost=207,580.65..660,891.69 rows=111 width=1,202) (actual time=97,614.935..1,898,883.320 rows=1,498 loops=1)

  • Hash Cond: ((o.orientamento_prod = op.descrizione_codice_orientamento) AND ((o.specie_allev)::text = op.specie_allevata) AND (o.tipologia_strutt = op.descrizione_tipo_produzione))
7. 102.234 1,898,874.049 ↓ 13.5 1,498 1

Hash Join (cost=207,566.53..660,866.73 rows=111 width=1,217) (actual time=97,614.216..1,898,874.049 rows=1,498 loops=1)

  • Hash Cond: (ticket.ticketid = tipi.idcontrollo)
8. 240.954 1,898,761.863 ↑ 1.8 79,960 1

Hash Left Join (cost=200,195.44..652,947.18 rows=145,961 width=1,213) (actual time=35,659.763..1,898,761.863 rows=79,960 loops=1)

  • Hash Cond: (ticket.site_id = asl1.code)
9. 1,680,514.805 1,898,520.855 ↑ 1.8 79,960 1

Nested Loop Left Join (cost=200,193.90..652,495.53 rows=145,961 width=697) (actual time=35,659.645..1,898,520.855 rows=79,960 loops=1)

  • Join Filter: ((comuni1.nome)::text ~~* (oa.city)::text)
  • Rows Removed by Join Filter: 647,196,399
10. 239.427 55,127.530 ↓ 22.2 79,960 1

Nested Loop Left Join (cost=200,193.90..214,368.79 rows=3,606 width=708) (actual time=35,659.123..55,127.530 rows=79,960 loops=1)

11. 458.101 47,371.863 ↓ 22.2 79,960 1

Nested Loop Left Join (cost=200,193.47..211,904.67 rows=3,606 width=556) (actual time=35,659.085..47,371.863 rows=79,960 loops=1)

12. 628.078 36,119.162 ↓ 22.2 79,960 1

Hash Right Join (cost=200,193.05..204,975.11 rows=3,606 width=545) (actual time=35,658.983..36,119.162 rows=79,960 loops=1)

  • Hash Cond: (risp.idmodist = ist.id)
  • Join Filter: (lcm.codice_specie = o.specie_allevamento)
  • Rows Removed by Join Filter: 19,994
13. 41.182 41.182 ↑ 1.0 76,544 1

Seq Scan on chk_bns_risposte risp (cost=0.00..3,558.44 rows=76,544 width=4) (actual time=0.019..41.182 rows=76,544 loops=1)

14. 297.011 35,449.902 ↓ 21.8 78,602 1

Hash (cost=200,147.97..200,147.97 rows=3,606 width=553) (actual time=35,449.902..35,449.902 rows=78,602 loops=1)

  • Buckets: 16,384 (originally 4096) Batches: 32 (originally 1) Memory Usage: 15,540kB
15. 627.631 35,152.891 ↓ 21.8 78,602 1

Nested Loop (cost=133.36..200,147.97 rows=3,606 width=553) (actual time=7.240..35,152.891 rows=78,602 loops=1)

16. 1,163.147 32,821.290 ↓ 9.8 283,995 1

Hash Left Join (cost=132.94..176,140.01 rows=28,905 width=449) (actual time=5.906..32,821.290 rows=283,995 loops=1)

  • Hash Cond: (ticket.ticketid = ist.idcu)
  • Filter: (((SubPlan 2) = 0) OR (lcm.code IS NULL) OR (lcm.code = ANY ('{20,22,23}'::integer[])))
  • Rows Removed by Filter: 5
17. 8,932.793 8,932.793 ↓ 1.1 283,788 1

Seq Scan on ticket (cost=0.00..164,561.13 rows=257,183 width=436) (actual time=0.240..8,932.793 rows=283,788 loops=1)

  • Filter: ((trashed_date IS NULL) AND (tipologia = 3) AND (assigned_date > ((((date_part('year'::text, now()) - '2'::double precision))::text || '-01-01'::text))::timestamp without time zone))
  • Rows Removed by Filter: 1,228,656
18. 1.181 5.350 ↑ 1.0 2,402 1

Hash (cost=102.91..102.91 rows=2,402 width=17) (actual time=5.350..5.350 rows=2,402 loops=1)

  • Buckets: 4,096 Batches: 1 Memory Usage: 148kB
19. 1.928 4.169 ↑ 1.0 2,402 1

Hash Left Join (cost=1.65..102.91 rows=2,402 width=17) (actual time=0.108..4.169 rows=2,402 loops=1)

  • Hash Cond: (ist.id_alleg = lcm.code)
20. 2.197 2.197 ↑ 1.0 2,402 1

Seq Scan on chk_bns_mod_ist ist (cost=0.00..94.03 rows=2,402 width=13) (actual time=0.017..2.197 rows=2,402 loops=1)

  • Filter: (trashed_date IS NULL)
  • Rows Removed by Filter: 1,701
21. 0.015 0.044 ↑ 1.0 29 1

Hash (cost=1.29..1.29 rows=29 width=8) (actual time=0.044..0.044 rows=29 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 10kB
22. 0.029 0.029 ↑ 1.0 29 1

Seq Scan on lookup_chk_bns_mod lcm (cost=0.00..1.29 rows=29 width=8) (actual time=0.016..0.029 rows=29 loops=1)

23.          

SubPlan (for Hash Left Join)

24. 22,720.000 22,720.000 ↑ 1,000.0 1 284,000

ProjectSet (cost=0.00..5.27 rows=1,000 width=4) (actual time=0.079..0.080 rows=1 loops=284,000)

25. 0.000 0.000 ↑ 1.0 1 284,000

Result (cost=0.00..0.01 rows=1 width=0) (actual time=0.000..0.000 rows=1 loops=284,000)

26. 1,703.970 1,703.970 ↓ 0.0 0 283,995

Index Scan using organization_org_id_idx on organization o (cost=0.42..0.83 rows=1 width=112) (actual time=0.006..0.006 rows=0 loops=283,995)

  • Index Cond: (org_id = ticket.org_id)
  • Filter: ((trashed_date IS NULL) AND (tipologia = 2))
  • Rows Removed by Filter: 0
27. 10,794.600 10,794.600 ↑ 1.0 1 79,960

Index Scan using organization_address_org_id_idx on organization_address oa (cost=0.42..1.91 rows=1 width=15) (actual time=0.133..0.135 rows=1 loops=79,960)

  • Index Cond: (org_id = o.org_id)
  • Filter: (address_type = 1)
  • Rows Removed by Filter: 0
28. 7,516.240 7,516.240 ↑ 1.0 1 79,960

Index Scan using nucleo_ispettivo_mv_id_controllo_ufficiale_idx on nucleo_ispettivo_mv nucleo (cost=0.42..0.67 rows=1 width=156) (actual time=0.091..0.094 rows=1 loops=79,960)

  • Index Cond: (id_controllo_ufficiale = ticket.ticketid)
29. 162,872.481 162,878.520 ↑ 1.0 8,095 79,960

Materialize (cost=0.00..288.43 rows=8,095 width=12) (actual time=0.000..2.037 rows=8,095 loops=79,960)

30. 6.039 6.039 ↑ 1.0 8,095 1

Seq Scan on comuni1 (cost=0.00..247.95 rows=8,095 width=12) (actual time=0.018..6.039 rows=8,095 loops=1)

31. 0.020 0.054 ↑ 1.0 24 1

Hash (cost=1.24..1.24 rows=24 width=520) (actual time=0.054..0.054 rows=24 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 10kB
32. 0.034 0.034 ↑ 1.0 24 1

Seq Scan on lookup_site_id asl1 (cost=0.00..1.24 rows=24 width=520) (actual time=0.025..0.034 rows=24 loops=1)

33. 0.552 9.952 ↑ 1.6 750 1

Hash (cost=7,356.45..7,356.45 rows=1,171 width=8) (actual time=9.952..9.952 rows=750 loops=1)

  • Buckets: 2,048 Batches: 1 Memory Usage: 46kB
34. 0.394 9.400 ↑ 1.6 750 1

Nested Loop (cost=0.43..7,356.45 rows=1,171 width=8) (actual time=0.604..9.400 rows=750 loops=1)

35. 3.878 3.878 ↓ 4.0 8 1

Seq Scan on lookup_piano_monitoraggio lpiani (cost=0.00..234.28 rows=2 width=4) (actual time=0.542..3.878 rows=8 loops=1)

  • Filter: (codice_interno = 1,483)
  • Rows Removed by Filter: 4,254
36. 5.128 5.128 ↑ 24.6 94 8

Index Scan using tipocontrolloufficialeimprese_pianomonitoraggio_idx on tipocontrolloufficialeimprese tipi (cost=0.43..3,537.95 rows=2,314 width=8) (actual time=0.028..0.641 rows=94 loops=8)

  • Index Cond: (pianomonitoraggio = lpiani.code)
  • Filter: enabled
  • Rows Removed by Filter: 27
37. 0.384 0.615 ↑ 1.0 368 1

Hash (cost=7.68..7.68 rows=368 width=50) (actual time=0.614..0.615 rows=368 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 38kB
38. 0.231 0.231 ↑ 1.0 368 1

Seq Scan on orientamenti_produttivi op (cost=0.00..7.68 rows=368 width=50) (actual time=0.038..0.231 rows=368 loops=1)

39. 0.022 0.044 ↑ 1.0 34 1

Hash (cost=1.34..1.34 rows=34 width=516) (actual time=0.044..0.044 rows=34 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 10kB
40. 0.022 0.022 ↑ 1.0 34 1

Seq Scan on lookup_specie_allevata specie (cost=0.00..1.34 rows=34 width=516) (actual time=0.011..0.022 rows=34 loops=1)

41.          

SubPlan (for Hash Left Join)

42. 521.304 522.802 ↑ 1,000.0 1 1,498

ProjectSet (cost=0.00..5.27 rows=1,000 width=4) (actual time=0.348..0.349 rows=1 loops=1,498)

43. 1.498 1.498 ↑ 1.0 1 1,498

Result (cost=0.00..0.01 rows=1 width=0) (actual time=0.000..0.001 rows=1 loops=1,498)

Planning time : 15.473 ms
Execution time : 1,899,606.856 ms