explain.depesz.com

PostgreSQL's explain analyze made readable

Result: dKdD

Settings
# exclusive inclusive rows x rows loops node
1. 0.000 0.000 ↓ 0.0

HashAggregate (cost=2,740.24..2,740.80 rows=2 width=993) (actual rows= loops=)

  • Group Key: CASE WHEN (COALESCE(pr.flg_cdbarnfe, 'N'::bpchar) <> 'S'::bpchar) THEN cod_barra(pr.*) ELSE NULL::numeric END, pr.cod_reduzido, pr.nom_produto, pr.cod_clafiscal, pr.cod_cest, COALESCE(pr.cod_unidade, 'UN'::character varying), CASE WHEN (((pr.t (...)
2. 0.000 0.000 ↓ 0.0

Nested Loop (cost=9.81..2,740.11 rows=2 width=993) (actual rows= loops=)

  • Join Filter: ((cv.num_cupom >= ce.num_cooinic) AND (cv.num_cupom <= ce.num_coofim))
3. 0.000 0.000 ↓ 0.0

Hash Join (cost=9.38..2,672.22 rows=119 width=1,025) (actual rows= loops=)

  • Hash Cond: (iv.prc_icms = ie.cod_sittrib)
4. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.71..2,657.43 rows=789 width=1,028) (actual rows= loops=)

5. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.28..2,356.12 rows=9 width=984) (actual rows= loops=)

6. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.28..11.48 rows=1 width=24) (actual rows= loops=)

  • Join Filter: (ce.num_contredz = redz.crz)
7. 0.000 0.000 ↓ 0.0

Index Scan using cadcecfi_pkey on cadcecfi ce (cost=0.28..8.31 rows=1 width=48) (actual rows= loops=)

  • Index Cond: ((cod_rede = 1) AND (cod_filial = 1) AND (num_ecf = 3) AND (dat_emissao = '2019-10-08'::date))
  • Filter: ((num_serie)::text = 'BE091410100011233061'::text)
8. 0.000 0.000 ↓ 0.0

Seq Scan on paf_reducao_z redz (cost=0.00..3.16 rows=1 width=29) (actual rows= loops=)

  • Filter: ((data_movimento = '2019-10-08'::date) AND ((numero_fabricacao)::text = 'BE091410100011233061'::text))
9. 0.000 0.000 ↓ 0.0

Seq Scan on cadprodu pr (cost=0.00..2,059.91 rows=28,473 width=960) (actual rows= loops=)

  • Filter: (cod_rede = 1)
10. 0.000 0.000 ↓ 0.0

Index Scan using idx_cadivend_cod_rede_cod_filial_cod_reduzido on cadivend iv (cost=0.43..30.88 rows=260 width=52) (actual rows= loops=)

  • Index Cond: ((cod_rede = 1) AND (cod_filial = 1) AND (cod_reduzido = pr.cod_reduzido))
11. 0.000 0.000 ↓ 0.0

Hash (cost=8.63..8.63 rows=3 width=21) (actual rows= loops=)

12. 0.000 0.000 ↓ 0.0

Index Scan using idx_cadiecfi_dat_emissao on cadiecfi ie (cost=0.29..8.63 rows=3 width=21) (actual rows= loops=)

  • Index Cond: (dat_emissao = '2019-10-08'::date)
  • Filter: ((cod_filial = 1) AND (cod_rede = 1) AND (num_ecf = 3))
13. 0.000 0.000 ↓ 0.0

Index Scan using cadcvend_pkey on cadcvend cv (cost=0.43..0.55 rows=1 width=20) (actual rows= loops=)

  • Index Cond: ((cod_rede = 1) AND (cod_filial = 1) AND (num_nota = iv.num_nota))
  • Filter: ((num_cupom IS NOT NULL) AND (num_ecf = 3) AND (tip_venda = 'V'::bpchar))