explain.depesz.com

PostgreSQL's explain analyze made readable

Result: QAI

Settings
# exclusive inclusive rows x rows loops node
1. 0.027 5,917.355 ↑ 1.0 1 1

Sort (cost=271,064.85..271,064.85 rows=1 width=1,144) (actual time=5,917.354..5,917.355 rows=1 loops=1)

  • Sort Key: (avg(CASE WHEN (medicaoindicador.valor IS NULL) THEN NULL::numeric WHEN (indicador.desempenhomelhor = 'A'::bpchar) THEN round(LEAST(GREATEST((((medicaoindicador.valor - indicador.desempenhominimo) / (indicador.desempenhomaximo - indicador.desempenhominimo)) * '100'::numeric), '0'::numeric), '100'::numeric), 2) ELSE round(LEAST(GREATEST((((indicador.desempenhomaximo - medicaoindicador.valor) / (indicador.desempenhomaximo - indicador.desempenhominimo)) * '100'::numeric), '0'::numeric), '100'::numeric), 2) END))
  • Sort Method: quicksort Memory: 34kB
2. 5,646.509 5,917.328 ↑ 1.0 1 1

Aggregate (cost=271,064.80..271,064.84 rows=1 width=1,144) (actual time=5,917.328..5,917.328 rows=1 loops=1)

3. 109.971 270.819 ↑ 1.0 135,006 1

Hash Join (cost=154.26..6,452.98 rows=135,006 width=67) (actual time=2.719..270.819 rows=135,006 loops=1)

  • Hash Cond: (medicaoindicador.unidadenegocioid = unidadenegocio.id)
4. 111.203 159.577 ↑ 1.0 135,006 1

Hash Join (cost=97.88..4,540.28 rows=135,006 width=67) (actual time=1.435..159.577 rows=135,006 loops=1)

  • Hash Cond: (medicaoindicador.indicadorid = indicador.id)
5. 46.956 46.956 ↑ 1.0 135,006 1

Seq Scan on medicoeseerros medicaoindicador (cost=0.00..2,586.06 rows=135,006 width=35) (actual time=0.005..46.956 rows=135,006 loops=1)

6. 0.163 1.418 ↓ 1.0 311 1

Hash (cost=94.06..94.06 rows=306 width=40) (actual time=1.418..1.418 rows=311 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 33kB
7. 0.162 1.255 ↓ 1.0 311 1

Hash Join (cost=18.17..94.06 rows=306 width=40) (actual time=0.349..1.255 rows=311 loops=1)

  • Hash Cond: (indicador.classificacaoinvestimentoid = classificacaoinvestimento.id)
8. 0.180 1.015 ↓ 1.0 311 1

Hash Join (cost=13.63..85.31 rows=306 width=48) (actual time=0.257..1.015 rows=311 loops=1)

  • Hash Cond: (indicador.classificacaoramoatividadeid = classificacaoramoatividade.id)
9. 0.196 0.762 ↓ 1.0 311 1

Hash Join (cost=9.09..76.56 rows=306 width=56) (actual time=0.174..0.762 rows=311 loops=1)

  • Hash Cond: (indicador.classificacaogestaoid = classificacaogestao.id)
10. 0.277 0.485 ↓ 1.0 311 1

Hash Join (cost=4.54..67.81 rows=306 width=42) (actual time=0.084..0.485 rows=311 loops=1)

  • Hash Cond: (indicador.classificacaodepartamentoid = classificacaodepartamento.id)
11. 0.138 0.138 ↓ 1.0 311 1

Seq Scan on indicador (cost=0.00..59.06 rows=306 width=50) (actual time=0.003..0.138 rows=311 loops=1)

12. 0.035 0.070 ↓ 1.1 119 1

Hash (cost=3.13..3.13 rows=113 width=8) (actual time=0.070..0.070 rows=119 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 13kB
13. 0.035 0.035 ↓ 1.1 119 1

Seq Scan on classificacaoindicador classificacaodepartamento (cost=0.00..3.13 rows=113 width=8) (actual time=0.003..0.035 rows=119 loops=1)

14. 0.041 0.081 ↓ 1.1 119 1

Hash (cost=3.13..3.13 rows=113 width=30) (actual time=0.081..0.081 rows=119 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 16kB
15. 0.040 0.040 ↓ 1.1 119 1

Seq Scan on classificacaoindicador classificacaogestao (cost=0.00..3.13 rows=113 width=30) (actual time=0.003..0.040 rows=119 loops=1)

16. 0.032 0.073 ↓ 1.1 119 1

Hash (cost=3.13..3.13 rows=113 width=8) (actual time=0.073..0.073 rows=119 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 13kB
17. 0.041 0.041 ↓ 1.1 119 1

Seq Scan on classificacaoindicador classificacaoramoatividade (cost=0.00..3.13 rows=113 width=8) (actual time=0.004..0.041 rows=119 loops=1)

18. 0.038 0.078 ↓ 1.1 119 1

Hash (cost=3.13..3.13 rows=113 width=8) (actual time=0.078..0.078 rows=119 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 13kB
19. 0.040 0.040 ↓ 1.1 119 1

Seq Scan on classificacaoindicador classificacaoinvestimento (cost=0.00..3.13 rows=113 width=8) (actual time=0.005..0.040 rows=119 loops=1)

20. 0.291 1.271 ↑ 1.1 947 1

Hash (cost=43.41..43.41 rows=1,037 width=8) (actual time=1.271..1.271 rows=947 loops=1)

  • Buckets: 2048 Batches: 1 Memory Usage: 53kB
21. 0.569 0.980 ↑ 1.1 947 1

Hash Join (cost=8.13..43.41 rows=1,037 width=8) (actual time=0.185..0.980 rows=947 loops=1)

  • Hash Cond: (unidadenegocio.organizacaoid = organizacao.id)
22. 0.249 0.249 ↑ 1.1 947 1

Seq Scan on unidadenegocio (cost=0.00..22.37 rows=1,037 width=16) (actual time=0.009..0.249 rows=947 loops=1)

23. 0.086 0.162 ↓ 1.2 269 1

Hash (cost=5.28..5.28 rows=228 width=8) (actual time=0.162..0.162 rows=269 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 19kB
24. 0.076 0.076 ↓ 1.2 269 1

Seq Scan on organizacao (cost=0.00..5.28 rows=228 width=8) (actual time=0.004..0.076 rows=269 loops=1)