explain.depesz.com

PostgreSQL's explain analyze made readable

Result: FX0u

Settings
# exclusive inclusive rows x rows loops node
1. 1,377.420 9,160.550 ↓ 18.9 120,722 1

Merge Anti Join (cost=132,466.94..134,169.49 rows=6,393 width=49) (actual time=6,701.135..9,160.550 rows=120,722 loops=1)

  • Merge Cond: (((a.serie)::text = (b.ser)::text) AND (a.n_nf = b.n_nf))
  • Join Filter: ((a.cod_mod)::text = (b.mod)::text)
2. 2,438.249 5,452.674 ↓ 10.0 252,022 1

Sort (cost=101,458.23..101,521.00 rows=25,108 width=55) (actual time=4,811.256..5,452.674 rows=252,022 loops=1)

  • Sort Key: a.serie, a.n_nf
  • Sort Method: quicksort Memory: 41,585kB
3. 2,949.774 3,014.425 ↓ 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=67.098..3,014.425 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
4. 64.651 64.651 ↓ 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.650..64.651 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))
5. 1,352.932 2,330.456 ↑ 1.0 191,066 1

Sort (cost=31,008.69..31,509.28 rows=200,238 width=9) (actual time=1,885.858..2,330.456 rows=191,066 loops=1)

  • Sort Key: b.ser, b.n_nf
  • Sort Method: quicksort Memory: 15,101kB
6. 977.524 977.524 ↑ 1.0 191,066 1

Index Only Scan using raiz_nfe_cpf_cnpj_n_nf_ser_mod_idx on raiz_nfe b (cost=0.56..13,376.37 rows=200,238 width=9) (actual time=0.125..977.524 rows=191,066 loops=1)

  • Index Cond: ((cpf_cnpj = '32374580000173'::text) AND (mod = '65'::text))
  • Heap Fetches: 0
Planning time : 1.860 ms
Execution time : 9,361.850 ms