explain.depesz.com

PostgreSQL's explain analyze made readable

Result: qUqR

Settings
# exclusive inclusive rows x rows loops node
1. 2,345.752 9,979.257 ↓ 5.9 129,376 1

Nested Loop Anti Join (cost=811.61..304,436.46 rows=21,892 width=49) (actual time=65.792..9,979.257 rows=129,376 loops=1)

2. 3,286.200 3,349.131 ↓ 10.0 252,022 1

Bitmap Heap Scan on consulta_nfe_sefaz_saida a (cost=811.04..99,623.35 rows=25,108 width=55) (actual time=65.540..3,349.131 rows=252,022 loops=1)

  • Recheck Cond: ((id_empresa = 984) AND (d_emi >= '2020-01-01'::date) AND (d_emi <= '2020-09-30'::date) AND ((cod_mod)::text = '65'::text))
  • Filter: (pesquisa_fts @@ to_tsquery('autorizada'::text))
  • Rows Removed by Filter: 310
  • Heap Blocks: exact=7,281
3. 62.931 62.931 ↓ 10.0 252,332 1

Bitmap Index Scan on consulta_nfe_sefaz_saida_id_empresa_d_emi_cod_mod_idx (cost=0.00..804.76 rows=25,336 width=0) (actual time=62.929..62.931 rows=252,332 loops=1)

  • Index Cond: ((id_empresa = 984) AND (d_emi >= '2020-01-01'::date) AND (d_emi <= '2020-09-30'::date) AND ((cod_mod)::text = '65'::text))
4. 4,284.374 4,284.374 ↓ 0.0 0 252,022

Index Scan using unica_nota on raiz_nfe b (cost=0.57..8.15 rows=1 width=68) (actual time=0.017..0.017 rows=0 loops=252,022)

  • Index Cond: (((cpf_cnpj)::text = (("substring"((a.inf_nfe)::text, 7, 14))::character varying(14))::text) AND (a.n_nf = n_nf) AND ((a.cod_mod)::text = (mod)::text) AND ((mod)::text = '65'::text))
  • Filter: (((a.serie)::text = (ser)::text) AND ((a.inf_nfe)::text = (inf_nfe)::text))
  • Rows Removed by Filter: 1
Planning time : 2.439 ms
Execution time : 10,225.647 ms