explain.depesz.com

PostgreSQL's explain analyze made readable

Result: QBiF

Settings
# exclusive inclusive rows x rows loops node
1. 0.025 4,495.103 ↓ 13.0 13 1

Sort (cost=451.46..451.47 rows=1 width=338) (actual time=4,495.103..4,495.103 rows=13 loops=1)

  • Sort Key: z.datavalidazionedocumento
  • Sort Method: quicksort Memory: 28kB
2.          

CTE anagdocreg

3. 0.652 4,493.455 ↓ 8.2 330 1

WindowAgg (cost=447.76..448.46 rows=40 width=1,533) (actual time=4,492.757..4,493.455 rows=330 loops=1)

4.          

CTE anag

5. 1,715.692 1,715.692 ↓ 2.8 330 1

Index Scan using dmacl_t_anagregistry_identificativoassistito_idx on dmacl_t_anagregistry a (cost=0.00..136.47 rows=120 width=73) (actual time=62.507..1,715.692 rows=330 loops=1)

  • Index Cond: ((identificativoassistito)::text = 'VTTCRL50B45I024K'::text)
6. 1.627 4,492.803 ↓ 8.2 330 1

Sort (cost=311.29..311.39 rows=40 width=1,533) (actual time=4,492.738..4,492.803 rows=330 loops=1)

  • Sort Key: b.datavalidazionedocumento
  • Sort Method: quicksort Memory: 359kB
7. 1.575 4,491.176 ↓ 8.2 330 1

Nested Loop (cost=0.00..310.23 rows=40 width=1,533) (actual time=71.605..4,491.176 rows=330 loops=1)

8. 1,716.281 1,716.281 ↓ 2.8 330 1

CTE Scan on anag (cost=0.00..2.40 rows=120 width=8) (actual time=62.511..1,716.281 rows=330 loops=1)

9. 2,773.320 2,773.320 ↑ 1.0 1 330

Index Scan using ie_dmacl_t_doc_registry_idpazregistry on dmacl_t_doc_registry b (cost=0.00..2.56 rows=1 width=1,525) (actual time=8.402..8.404 rows=1 loops=330)

  • Index Cond: (idpazregistry = anag.idpazregistry)
  • Filter: (strpos((iddocumentooid)::text, '010'::text) > 0)
10. 0.174 4,495.078 ↓ 13.0 13 1

Nested Loop (cost=0.00..2.99 rows=1 width=338) (actual time=4,492.954..4,495.078 rows=13 loops=1)

  • Join Filter: (now() <= (z.datavalidazionedocumento + ('1 day'::interval * (COALESCE(d.durata_validita, 31))::double precision)))
  • Rows Removed by Join Filter: 34
11. 4,494.622 4,494.622 ↓ 47.0 47 1

CTE Scan on anagdocreg z (cost=0.00..1.70 rows=1 width=318) (actual time=4,492.891..4,494.622 rows=47 loops=1)

  • Filter: (((tipologiadcoumentomedio)::text = ANY ('{57833-6,57832-8}'::text[])) AND ((statodocentry)::text = 'APPROVED'::text) AND ((tipologiadocumentoalto)::text = 'PRS'::text) AND (rank = 1) AND ((tipologiadcoumentomedio)::text = '57832-8'::text) AND (datavalidazionedocumento >= to_timestamp('23/01/2018'::text, 'dd/mm/yyyy'::text)) AND (datavalidazionedocumento <= to_timestamp('04/02/2020'::text, 'dd/mm/yyyy'::text)))
  • Rows Removed by Filter: 283
12. 0.282 0.282 ↑ 1.0 1 47

Seq Scan on dmacl_d_catalogo_tipo_documento d (cost=0.00..1.26 rows=1 width=33) (actual time=0.003..0.006 rows=1 loops=47)

  • Filter: ((codice_tipo_doc)::text = '57832-8'::text)
  • Rows Removed by Filter: 20