explain.depesz.com

PostgreSQL's explain analyze made readable

Result: AFz6

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

GroupAggregate (cost=477,177.38..483,548.86 rows=38,615 width=352) (actual rows= loops=)

  • Group Key: nfc.nfc_cd_nfce, ptp.ptp_vl_pr_pis_saida, ptp.ptp_vl_pr_cofins_saida, cfo.cfo_ds_cfop
2. 0.000 0.000 ↓ 0.0

Sort (cost=477,177.38..477,273.92 rows=38,615 width=81) (actual rows= loops=)

  • Sort Key: nfc.nfc_cd_nfce, ptp.ptp_vl_pr_pis_saida, ptp.ptp_vl_pr_cofins_saida, cfo.cfo_ds_cfop
3. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=11,106.24..474,235.52 rows=38,615 width=81) (actual rows= loops=)

  • Join Filter: (ven.ven_cd_venda = nfc.nfc_cd_venda)
4. 0.000 0.000 ↓ 0.0

Index Scan using nfc_dt_emissao_unidade_negocio on nfce nfc (cost=0.56..109,427.51 rows=38,615 width=66) (actual rows= loops=)

  • Index Cond: ((nfc_dt_emissao >= '2019-02-01'::date) AND (nfc_dt_emissao <= '2019-02-28'::date) AND (nfc_cd_unidade_negocio = 144))
  • Filter: (nfc_fl_status <> 'D'::bpchar)
5. 0.000 0.000 ↓ 0.0

Materialize (cost=11,105.67..360,753.44 rows=1 width=23) (actual rows= loops=)

6. 0.000 0.000 ↓ 0.0

Nested Loop (cost=11,105.67..360,753.44 rows=1 width=23) (actual rows= loops=)

7. 0.000 0.000 ↓ 0.0

Nested Loop (cost=11,105.25..360,751.70 rows=1 width=21) (actual rows= loops=)

8. 0.000 0.000 ↓ 0.0

Nested Loop (cost=11,104.97..360,750.16 rows=1 width=17) (actual rows= loops=)

9. 0.000 0.000 ↓ 0.0

Gather (cost=11,104.54..360,748.41 rows=1 width=25) (actual rows= loops=)

  • Workers Planned: 3
10. 0.000 0.000 ↓ 0.0

Nested Loop (cost=10,104.54..359,748.31 rows=1 width=25) (actual rows= loops=)

11. 0.000 0.000 ↓ 0.0

Nested Loop (cost=10,104.11..359,746.56 rows=1 width=17) (actual rows= loops=)

12. 0.000 0.000 ↓ 0.0

Hash Join (cost=9,555.11..138,365.99 rows=262 width=4) (actual rows= loops=)

  • Hash Cond: (ven.ven_cd_caixa = cai.cai_cd_caixa)
13. 0.000 0.000 ↓ 0.0

Parallel Index Scan using venda_ven_cd_unidade_negocio_ven_fl_cancelada_ven_dt_fiscal_idx on venda ven (cost=0.57..128,759.69 rows=19,714 width=12) (actual rows= loops=)

  • Index Cond: ((ven_cd_unidade_negocio = 144) AND (ven_fl_cancelada = 'N'::bpchar) AND (ven_dt_fiscal >= '2019-02-01'::date) AND (ven_dt_fiscal <= '2019-02-28'::date))
  • Filter: (ven_ds_modelo = '65'::bpchar)
14. 0.000 0.000 ↓ 0.0

Hash (cost=8,093.41..8,093.41 rows=14,255 width=8) (actual rows= loops=)

15. 0.000 0.000 ↓ 0.0

Index Scan using caixa_idx_unidade_negocio on caixa cai (cost=0.43..8,093.41 rows=14,255 width=8) (actual rows= loops=)

  • Index Cond: (cai_cd_unidade_negocio = 144)
16. 0.000 0.000 ↓ 0.0

Bitmap Heap Scan on venda_item vei (cost=549.00..844.86 rows=1 width=17) (actual rows= loops=)

  • Recheck Cond: ((vei_cd_venda = ven.ven_cd_venda) AND (vei_dt_fiscal >= '2019-02-01'::date) AND (vei_dt_fiscal <= '2019-02-28'::date))
  • Filter: (vei_cd_unidade_negocio = 144)
17. 0.000 0.000 ↓ 0.0

BitmapAnd (cost=549.00..549.00 rows=381 width=0) (actual rows= loops=)

18. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on venda_item_idx_venda_rebuild_1 (cost=0.00..16.77 rows=1,563 width=0) (actual rows= loops=)

  • Index Cond: (vei_cd_venda = ven.ven_cd_venda)
19. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on venda_item_vei_dt_fiscal_idx_rebuild_1 (cost=0.00..486.15 rows=58,778,316 width=0) (actual rows= loops=)

  • Index Cond: ((vei_dt_fiscal >= '2019-02-01'::date) AND (vei_dt_fiscal <= '2019-02-28'::date))
20. 0.000 0.000 ↓ 0.0

Index Scan using produto_unidade_negocio_idx on produto_unidade_negocio pun (cost=0.43..1.75 rows=1 width=8) (actual rows= loops=)

  • Index Cond: ((pun_cd_produto = vei.vei_cd_produto) AND (pun_cd_unidade_negocio = 144))
21. 0.000 0.000 ↓ 0.0

Index Scan using produto_pkey on produto pro (cost=0.42..1.75 rows=1 width=4) (actual rows= loops=)

  • Index Cond: (pro_cd_produto = vei.vei_cd_produto)
  • Filter: (pro_cd_rede = 74)
22. 0.000 0.000 ↓ 0.0

Index Scan using produto_tribut_pis_cofins_pkey on produto_tribut_pis_cofins ptp (cost=0.28..1.53 rows=1 width=12) (actual rows= loops=)

  • Index Cond: (ptp_cd_produto_tribut_pis_cof = pun.pun_cd_produto_tribut_pis_cof)
23. 0.000 0.000 ↓ 0.0

Index Scan using cfop_pkey on cfop cfo (cost=0.42..1.73 rows=1 width=10) (actual rows= loops=)

  • Index Cond: (cfo_cd_cfop = vei.vei_cd_cfop)
  • Filter: (cfo_cd_rede = 74)