explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 2GFk

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

GroupAggregate (cost=482,234.80..488,592.09 rows=38,529 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=482,234.80..482,331.12 rows=38,529 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=80,611.96..479,300.11 rows=38,529 width=81) (actual rows= loops=)

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

Bitmap Heap Scan on nfce nfc (cost=69,550.10..114,566.38 rows=38,529 width=66) (actual rows= loops=)

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

BitmapAnd (cost=69,550.10..69,550.10 rows=38,529 width=0) (actual rows= loops=)

6. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on nfce_nfc_cd_unidade_negocio_idx (cost=0.00..5,224.81 rows=406,606 width=0) (actual rows= loops=)

  • Index Cond: (nfc_cd_unidade_negocio = 144)
7. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on nfce_nfc_dt_emissao_idx (cost=0.00..64,305.78 rows=4,187,951 width=0) (actual rows= loops=)

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

Materialize (cost=11,061.86..360,688.19 rows=1 width=23) (actual rows= loops=)

9. 0.000 0.000 ↓ 0.0

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

10. 0.000 0.000 ↓ 0.0

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

11. 0.000 0.000 ↓ 0.0

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

12. 0.000 0.000 ↓ 0.0

Gather (cost=11,060.73..360,683.15 rows=1 width=25) (actual rows= loops=)

  • Workers Planned: 3
13. 0.000 0.000 ↓ 0.0

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

14. 0.000 0.000 ↓ 0.0

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

15. 0.000 0.000 ↓ 0.0

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

  • Hash Cond: (ven.ven_cd_caixa = cai.cai_cd_caixa)
16. 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,721.80 rows=19,708 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)
17. 0.000 0.000 ↓ 0.0

Hash (cost=8,056.29..8,056.29 rows=14,189 width=8) (actual rows= loops=)

18. 0.000 0.000 ↓ 0.0

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

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

Bitmap Heap Scan on venda_item vei (cost=549.07..844.93 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)
20. 0.000 0.000 ↓ 0.0

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

21. 0.000 0.000 ↓ 0.0

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

  • Index Cond: (vei_cd_venda = ven.ven_cd_venda)
22. 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,840,665 width=0) (actual rows= loops=)

  • Index Cond: ((vei_dt_fiscal >= '2019-02-01'::date) AND (vei_dt_fiscal <= '2019-02-28'::date))
23. 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))
24. 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)
25. 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)
26. 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)