explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Rdi9 : teste

Settings

Optimization(s) for this plan:

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

Hash Left Join (cost=4,211.85..14,128.10 rows=33,032 width=94) (actual rows= loops=)

  • Hash Cond: (((rateiocomissao_temp.codemp)::numeric = centrocusto.empresa_id) AND ((rateiocomissao_temp.codccu)::text = (centrocusto.centro_custo)::text))
2. 0.000 0.000 ↓ 0.0

Hash Left Join (cost=4,176.38..12,424.54 rows=33,032 width=95) (actual rows= loops=)

  • Hash Cond: (((rateiocomissao_temp.codemp)::numeric = contacon.empresa_id) AND ((rateiocomissao_temp.ctared)::numeric = contacon.conta_contabil))
3. 0.000 0.000 ↓ 0.0

Hash Left Join (cost=3,417.58..9,515.85 rows=33,032 width=99) (actual rows= loops=)

  • Hash Cond: (((rateiocomissao_temp.codemp)::numeric = fase.empresa_id) AND (projeto.id = fase.projeto_id) AND ((rateiocomissao_temp.codfpj)::numeric = fase.fase))
4. 0.000 0.000 ↓ 0.0

Hash Left Join (cost=3,404.28..9,048.35 rows=33,032 width=99) (actual rows= loops=)

  • Hash Cond: (((rateiocomissao_temp.codemp)::numeric = projeto.empresa_id) AND ((rateiocomissao_temp.numprj)::numeric = projeto.projeto))
5. 0.000 0.000 ↓ 0.0

Merge Left Join (cost=3,390.03..8,702.38 rows=33,032 width=103) (actual rows= loops=)

  • Merge Cond: ((rateiocomissao_temp.codemp)::numeric = contafin.empresa_id)
  • Join Filter: (contafin.conta_financeira = (rateiocomissao_temp.ctafin)::numeric)
6. 0.000 0.000 ↓ 0.0

Merge Left Join (cost=3,367.39..7,254.83 rows=33,032 width=107) (actual rows= loops=)

  • Merge Cond: (((rateiocomissao_temp.codemp)::numeric = comissao.empresa_id) AND ((rateiocomissao_temp.codfil)::numeric = comissao.filial))
  • Join Filter: ((comissao.representante_id = rateiocomissao_temp.codrep) AND (comissao.sequencia_comissao = (rateiocomissao_temp.seqcom)::numeric))
7. 0.000 0.000 ↓ 0.0

Merge Left Join (cost=3,366.98..3,782.37 rows=33,032 width=99) (actual rows= loops=)

  • Merge Cond: ((((rateiocomissao_temp.codemp)::numeric) = fil.empresa_id) AND (((rateiocomissao_temp.codfil)::numeric) = fil.filial))
8. 0.000 0.000 ↓ 0.0

Sort (cost=3,351.63..3,434.21 rows=33,032 width=95) (actual rows= loops=)

  • Sort Key: ((rateiocomissao_temp.codemp)::numeric), ((rateiocomissao_temp.codfil)::numeric)
9. 0.000 0.000 ↓ 0.0

Seq Scan on rateiocomissao_temp (cost=0.00..872.32 rows=33,032 width=95) (actual rows= loops=)

10. 0.000 0.000 ↓ 0.0

Sort (cost=15.34..15.64 rows=120 width=28) (actual rows= loops=)

  • Sort Key: fil.empresa_id, fil.filial
11. 0.000 0.000 ↓ 0.0

Seq Scan on filial fil (cost=0.00..11.20 rows=120 width=28) (actual rows= loops=)

12. 0.000 0.000 ↓ 0.0

Index Scan using uk_comissao2 on comissao (cost=0.41..2,333.80 rows=33,059 width=31) (actual rows= loops=)

13. 0.000 0.000 ↓ 0.0

Sort (cost=22.64..23.48 rows=339 width=14) (actual rows= loops=)

  • Sort Key: contafin.empresa_id
14. 0.000 0.000 ↓ 0.0

Seq Scan on contafinanceira contafin (cost=0.00..8.39 rows=339 width=14) (actual rows= loops=)

15. 0.000 0.000 ↓ 0.0

Hash (cost=11.70..11.70 rows=170 width=30) (actual rows= loops=)

16. 0.000 0.000 ↓ 0.0

Seq Scan on projeto (cost=0.00..11.70 rows=170 width=30) (actual rows= loops=)

17. 0.000 0.000 ↓ 0.0

Hash (cost=11.20..11.20 rows=120 width=32) (actual rows= loops=)

18. 0.000 0.000 ↓ 0.0

Seq Scan on faseprojeto fase (cost=0.00..11.20 rows=120 width=32) (actual rows= loops=)

19. 0.000 0.000 ↓ 0.0

Hash (cost=484.72..484.72 rows=18,272 width=15) (actual rows= loops=)

20. 0.000 0.000 ↓ 0.0

Seq Scan on contacontabil contacon (cost=0.00..484.72 rows=18,272 width=15) (actual rows= loops=)

21. 0.000 0.000 ↓ 0.0

Hash (cost=22.59..22.59 rows=859 width=13) (actual rows= loops=)

22. 0.000 0.000 ↓ 0.0

Seq Scan on centrocusto (cost=0.00..22.59 rows=859 width=13) (actual rows= loops=)