explain.depesz.com

PostgreSQL's explain analyze made readable

Result: BoQw

Settings
# exclusive inclusive rows x rows loops node
1. 2,303.320 9,697.364 ↓ 5.2 129,376 1

HashSetOp Except (cost=811.04..342,612.24 rows=25,108 width=114) (actual time=9,325.779..9,697.364 rows=129,376 loops=1)

2. 1,598.479 7,394.044 ↓ 4.1 443,088 1

Append (cost=811.04..342,069.61 rows=108,526 width=114) (actual time=65.889..7,394.044 rows=443,088 loops=1)

3. 1,101.899 4,335.355 ↓ 10.0 252,022 1

Subquery Scan on *SELECT* 1 (cost=811.04..99,874.43 rows=25,108 width=53) (actual time=65.884..4,335.355 rows=252,022 loops=1)

4. 3,170.142 3,233.456 ↓ 10.0 252,022 1

Bitmap Heap Scan on consulta_nfe_sefaz_saida a (cost=811.04..99,623.35 rows=25,108 width=49) (actual time=65.877..3,233.456 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
5. 63.314 63.314 ↓ 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=63.312..63.314 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))
6. 771.992 1,460.210 ↓ 2.3 191,066 1

Subquery Scan on *SELECT* 2 (cost=3,167.06..242,195.18 rows=83,418 width=53) (actual time=95.531..1,460.210 rows=191,066 loops=1)

7. 600.017 688.218 ↓ 2.3 191,066 1

Bitmap Heap Scan on raiz_nfe a_1 (cost=3,167.06..241,361.00 rows=83,418 width=49) (actual time=95.522..688.218 rows=191,066 loops=1)

  • Recheck Cond: (((cpf_cnpj)::text = '32374580000173'::text) AND (d_emi >= '2020-01-01'::date) AND (d_emi <= '2020-09-30'::date) AND ((mod)::text = '65'::text))
  • Heap Blocks: exact=19,197
8. 88.201 88.201 ↓ 2.3 191,066 1

Bitmap Index Scan on raiz_nfe_cpf_cnpj_d_emi_mod_idx (cost=0.00..3,146.21 rows=83,418 width=0) (actual time=88.199..88.201 rows=191,066 loops=1)

  • Index Cond: (((cpf_cnpj)::text = '32374580000173'::text) AND (d_emi >= '2020-01-01'::date) AND (d_emi <= '2020-09-30'::date) AND ((mod)::text = '65'::text))
Planning time : 0.982 ms
Execution time : 10,029.198 ms