explain.depesz.com

PostgreSQL's explain analyze made readable

Result: NKlI1

Settings
# exclusive inclusive rows x rows loops node
1. 0.077 2,620.603 ↓ 50.0 50 1

Limit (cost=1.69..1,162,881.34 rows=1 width=204) (actual time=86.402..2,620.603 rows=50 loops=1)

2. 2.551 2,620.526 ↓ 50.0 50 1

Nested Loop (cost=1.69..1,162,881.34 rows=1 width=204) (actual time=86.399..2,620.526 rows=50 loops=1)

3. 358.588 2,614.075 ↓ 50.0 50 1

Nested Loop (cost=1.12..1,162,875.66 rows=1 width=217) (actual time=86.202..2,614.075 rows=50 loops=1)

  • Join Filter: (e.conf_codigo = c.conf_codigo)
  • Rows Removed by Join Filter: 2,327,884
4. 0.073 24.587 ↓ 50.0 50 1

Nested Loop (cost=1.12..1,157,759.83 rows=1 width=217) (actual time=4.889..24.587 rows=50 loops=1)

5. 2.654 2.654 ↑ 1.0 1 1

Seq Scan on empresa e (cost=0.00..945.62 rows=1 width=22) (actual time=2.654..2.654 rows=1 loops=1)

  • Filter: (emp_codigo = 11,149)
  • Rows Removed by Filter: 6,261
6. 0.430 21.860 ↓ 50.0 50 1

Nested Loop (cost=1.12..1,156,814.17 rows=1 width=199) (actual time=2.216..21.860 rows=50 loops=1)

7. 0.763 10.925 ↓ 191.0 191 1

Nested Loop (cost=0.56..1,156,808.49 rows=1 width=158) (actual time=0.143..10.925 rows=191 loops=1)

8. 0.421 0.421 ↓ 191.0 191 1

Seq Scan on nfe_ident ni (cost=0.00..1,156,799.80 rows=1 width=82) (actual time=0.016..0.421 rows=191 loops=1)

  • Filter: ((dhemi >= '2020-08-17 00:00:00-03'::timestamp with time zone) AND (dhemi <= '2020-08-26 00:00:00-03'::timestamp with time zone))
  • Rows Removed by Filter: 1
9. 9.741 9.741 ↑ 1.0 1 191

Index Scan using pk_nfe on nfe n (cost=0.56..8.64 rows=1 width=76) (actual time=0.050..0.051 rows=1 loops=191)

  • Index Cond: (((cnpj_emitente)::text = (ni.cnpj_emitente)::text) AND (numero = ni.numero) AND (serie = ni.serie) AND (tpamb = ni.tpamb) AND ((mod)::text = (ni.mod)::text))
10. 10.505 10.505 ↓ 0.0 0 191

Index Scan using idx_nfe_empresa on nfe_empresa ng (cost=0.56..5.62 rows=1 width=41) (actual time=0.054..0.055 rows=0 loops=191)

  • Index Cond: (((cnpj_emitente)::text = (n.cnpj_emitente)::text) AND (numero = n.numero) AND (serie = n.serie) AND (tpamb = n.tpamb) AND ((mod)::text = (n.mod)::text))
  • Filter: (emp_codigo = 11,149)
  • Rows Removed by Filter: 1
11. 2,230.900 2,230.900 ↑ 1.0 46,559 50

Seq Scan on configuracao c (cost=0.00..2,670.80 rows=46,572 width=8) (actual time=0.007..44.618 rows=46,559 loops=50)

12. 3.900 3.900 ↑ 1.0 1 50

Index Scan using pk_nfe_emitente on nfe_emitente ne (cost=0.56..5.61 rows=1 width=60) (actual time=0.077..0.078 rows=1 loops=50)

  • Index Cond: (((cnpj_emitente)::text = (n.cnpj_emitente)::text) AND (numero = n.numero) AND (serie = n.serie) AND (tpamb = n.tpamb) AND ((mod)::text = (n.mod)::text))