explain.depesz.com

PostgreSQL's explain analyze made readable

Result: kMqF

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

HashSetOp Except (cost=811.04..342,340.92 rows=25,108 width=110) (actual time=9,482.272..9,847.520 rows=129,376 loops=1)

2. 1,610.828 7,469.114 ↓ 4.1 443,088 1

Append (cost=811.04..342,069.61 rows=108,526 width=110) (actual time=66.888..7,469.114 rows=443,088 loops=1)

3. 1,064.966 4,325.817 ↓ 10.0 252,022 1

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

4. 3,196.585 3,260.851 ↓ 10.0 252,022 1

Bitmap Heap Scan on consulta_nfe_sefaz_saida a (cost=811.04..99,623.35 rows=25,108 width=45) (actual time=66.878..3,260.851 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. 64.266 64.266 ↓ 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=64.264..64.266 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. 804.420 1,532.469 ↓ 2.3 191,066 1

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

7. 614.706 728.049 ↓ 2.3 191,066 1

Bitmap Heap Scan on raiz_nfe a_1 (cost=3,167.06..241,361.00 rows=83,418 width=45) (actual time=121.116..728.049 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. 113.343 113.343 ↓ 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=113.342..113.343 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 : 1.447 ms
Execution time : 10,161.498 ms