explain.depesz.com

PostgreSQL's explain analyze made readable

Result: UNdU

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

Unique (cost=20,229.79..20,289.64 rows=855 width=1,514) (actual rows= loops=)

2. 0.000 0.000 ↓ 0.0

Sort (cost=20,229.79..20,231.93 rows=855 width=1,514) (actual rows= loops=)

  • Sort Key: c.des_ciclo, m.des_canal, m.des_tamanho, m.des_regiao, mb.des_bandeira, mbp.des_tts, dc.divisao, m.des_categoria, m.des_subcategoria, (COALESCE(ert.des_marca, mp.des_marca)), mp.des_produto, mp.cd_produto, (COALESCE(mp.ean, '-'::character varying)), (COALESCE(ert.tipo_promocao, mp.tipo_promocao)), (COALESCE(ert.mes_cobranca, mtc.mes_cobranca, mtcp.mes_cobranca)), (COALESCE(ert.des_produto_relativo, mbp.des_produto_concorrente)), (COALESCE(ert.ean_produto_relativo, mbp.ean_concorrente)), (COALESCE(ert.cd_produto_relativo, mbp.cd_produto_concorrente)), (round((COALESCE(ert.vlr_minimo, mbp.vlr_minimo))::numeric, 2)), (round((COALESCE(ert.vlr_maximo, mbp.vlr_maximo))::numeric, 2)), (round((COALESCE(ert.vlr_estrategico, mbp.vlr_estrategico))::numeric, 2)), (COALESCE(ert.target, mb.vlr_target)), ((((COALESCE(ert.vlr_minimo_prc, mbp.vlr_minimo_prc))::text || ' - '::text) || (COALESCE(ert.vlr_maximo_prc, mbp.vlr_maximo_prc))::text)), pc.cd_pergunta, (COALESCE(ert.des_pergunta, mp.des_pergunta)), (COALESCE(ert.des_universo, mp.des_universo)), (COALESCE(ert.tipo_cobranca, mtc.tipo_cobranca, mtcp.tipo_cobranca))
3. 0.000 0.000 ↓ 0.0

Hash Left Join (cost=3,383.54..20,188.15 rows=855 width=1,514) (actual rows= loops=)

  • Hash Cond: (((COALESCE(ert.des_pergunta, mp.des_pergunta))::text = (pc.des_pergunta)::text) AND ((m.des_categoria)::text = (pc.des_categoria)::text))
4. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=3,374.42..20,140.21 rows=855 width=1,634) (actual rows= loops=)

5. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=3,374.12..19,750.29 rows=855 width=1,620) (actual rows= loops=)

  • Join Filter: ((ert.id_meta_produto = mp.id) AND (ert.id_meta_bandeira_produto = mbp.id))
  • Filter: (((ert.ind_excluido IS NULL) OR ((ert.ind_excluido)::text <> 'SIM'::text)) AND ((ert.id IS NULL) OR ((ert.ind_status)::text = ANY ('{APROVADO,AGUARDANDO_APROVACAO,ELABORACAO}'::text[]))))
6. 0.000 0.000 ↓ 0.0

Hash Right Join (cost=3,373.70..9,759.74 rows=1,179 width=584) (actual rows= loops=)

  • Hash Cond: (mtc.id_meta_bandeira_produto = mbp.id)
7. 0.000 0.000 ↓ 0.0

Seq Scan on mes_tipo_cobranca mtc (cost=0.00..5,244.68 rows=303,468 width=21) (actual rows= loops=)

8. 0.000 0.000 ↓ 0.0

Hash (cost=3,358.96..3,358.96 rows=1,179 width=567) (actual rows= loops=)

9. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=3.09..3,358.96 rows=1,179 width=567) (actual rows= loops=)

  • Filter: (((mbp.id IS NOT NULL) OR ((k.nom_kpi)::text = 'FACING'::text)) AND ((mbp.id IS NULL) OR ((mbp.ind_excluido)::text <> 'SIM'::text)))
10. 0.000 0.000 ↓ 0.0

Nested Loop (cost=2.67..939.21 rows=2,827 width=270) (actual rows= loops=)

11. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=2.25..291.24 rows=431 width=244) (actual rows= loops=)

12. 0.000 0.000 ↓ 0.0

Hash Join (cost=1.83..168.39 rows=86 width=75) (actual rows= loops=)

  • Hash Cond: ((m.des_categoria)::text = (dc.categoria)::text)
13. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.29..165.67 rows=86 width=72) (actual rows= loops=)

14. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.00..3.95 rows=1 width=30) (actual rows= loops=)

15. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.00..2.84 rows=1 width=17) (actual rows= loops=)

  • Join Filter: (p.id_kpi = k.id)
16. 0.000 0.000 ↓ 0.0

Seq Scan on kpi k (cost=0.00..1.16 rows=1 width=13) (actual rows= loops=)

  • Filter: ((nom_kpi)::text = 'PRIORITARIO'::text)
17. 0.000 0.000 ↓ 0.0

Seq Scan on planejamento p (cost=0.00..1.62 rows=4 width=12) (actual rows= loops=)

  • Filter: (id_ciclo = 11)
18. 0.000 0.000 ↓ 0.0

Seq Scan on ciclo c (cost=0.00..1.10 rows=1 width=21) (actual rows= loops=)

  • Filter: (id = 11)
19. 0.000 0.000 ↓ 0.0

Index Scan using meta_id_planejamento_idx on meta m (cost=0.29..158.86 rows=286 width=46) (actual rows= loops=)

  • Index Cond: (id_planejamento = p.id)
  • Filter: (((des_canal)::text = ANY ('{KA,MV}'::text[])) AND ((ind_status)::text = 'APROVADO'::text))
20. 0.000 0.000 ↓ 0.0

Hash (cost=1.24..1.24 rows=24 width=14) (actual rows= loops=)

21. 0.000 0.000 ↓ 0.0

Seq Scan on divisao_categoria dc (cost=0.00..1.24 rows=24 width=14) (actual rows= loops=)

22. 0.000 0.000 ↓ 0.0

Index Scan using meta_produto_id_meta_idx on meta_produto mp (cost=0.42..1.35 rows=8 width=173) (actual rows= loops=)

  • Index Cond: (id_meta = m.id)
23. 0.000 0.000 ↓ 0.0

Index Scan using meta_bandeira_id_meta_idx on meta_bandeira mb (cost=0.42..1.37 rows=13 width=30) (actual rows= loops=)

  • Index Cond: (id_meta = m.id)
  • Filter: (id IS NOT NULL)
24. 0.000 0.000 ↓ 0.0

Index Scan using idx_mbp on meta_bandeira_produto mbp (cost=0.43..0.84 rows=1 width=309) (actual rows= loops=)

  • Index Cond: ((id_meta_bandeira = mb.id) AND (id_meta_produto = mp.id))
25. 0.000 0.000 ↓ 0.0

Index Scan using idx_errata on errata ert (cost=0.42..8.45 rows=1 width=1,089) (actual rows= loops=)

  • Index Cond: ((id_planejamento = p.id) AND (id_meta = m.id) AND (id_meta_bandeira = mb.id))
  • Filter: (to_date((mes_errata)::text, 'MM/yyyy'::text) >= to_date('02/2019'::text, 'MM/yyyy'::text))
26. 0.000 0.000 ↓ 0.0

Index Scan using mes_tipo_cobranca_produto_id_meta_produto_idx on mes_tipo_cobranca_produto mtcp (cost=0.29..0.41 rows=5 width=22) (actual rows= loops=)

  • Index Cond: (id_meta_produto = mp.id)
27. 0.000 0.000 ↓ 0.0

Hash (cost=6.05..6.05 rows=205 width=83) (actual rows= loops=)

28. 0.000 0.000 ↓ 0.0

Seq Scan on pergunta_codigo pc (cost=0.00..6.05 rows=205 width=83) (actual rows= loops=)