explain.depesz.com

PostgreSQL's explain analyze made readable

Result: zuw

Settings
# exclusive inclusive rows x rows loops node
1. 4,338.774 5,159.628 ↑ 1.1 930 1

GroupAggregate (cost=24,727.76..207,393.26 rows=1,037 width=272) (actual time=746.771..5,159.628 rows=930 loops=1)

  • Group Key: (((lpad(((unidadenegocio.grupoclientealpha7)::character varying)::text, 3, '0'::text) || '-'::text) || lpad(((unidadenegocio.codigoclientealpha7)::character varying)::text, 4, '0'::text))), unidadenegocio.id
2.          

CTE medicoeseerros

3. 51.424 86.020 ↑ 1.0 135,003 1

Append (cost=0.00..3,956.61 rows=135,004 width=80) (actual time=0.005..86.020 rows=135,003 loops=1)

4. 33.972 33.972 ↑ 1.0 134,582 1

Seq Scan on ultimamedicao (cost=0.00..2,577.82 rows=134,582 width=51) (actual time=0.005..33.972 rows=134,582 loops=1)

5. 0.225 0.624 ↑ 1.0 421 1

Subquery Scan on *SELECT* 2 (cost=0.00..32.97 rows=422 width=80) (actual time=0.037..0.624 rows=421 loops=1)

6. 0.399 0.399 ↑ 1.0 421 1

Seq Scan on erromedicaoindicador (cost=0.00..27.70 rows=422 width=76) (actual time=0.034..0.399 rows=421 loops=1)

  • Filter: (datahora >= (('now'::cstring)::date - '1 mon'::interval))
  • Rows Removed by Filter: 11
7. 425.867 820.854 ↑ 1.0 135,003 1

Sort (cost=20,771.15..21,108.66 rows=135,004 width=106) (actual time=740.218..820.854 rows=135,003 loops=1)

  • Sort Key: (((lpad(((unidadenegocio.grupoclientealpha7)::character varying)::text, 3, '0'::text) || '-'::text) || lpad(((unidadenegocio.codigoclientealpha7)::character varying)::text, 4, '0'::text))), unidadenegocio.id
  • Sort Method: quicksort Memory: 25129kB
8. 151.170 394.987 ↑ 1.0 135,003 1

Hash Join (cost=154.26..9,267.03 rows=135,004 width=106) (actual time=2.588..394.987 rows=135,003 loops=1)

  • Hash Cond: (medicaoindicador.unidadenegocioid = unidadenegocio.id)
9. 85.319 242.546 ↑ 1.0 135,003 1

Hash Join (cost=97.88..4,654.27 rows=135,004 width=74) (actual time=1.299..242.546 rows=135,003 loops=1)

  • Hash Cond: (medicaoindicador.indicadorid = indicador.id)
10. 155.941 155.941 ↑ 1.0 135,003 1

CTE Scan on medicoeseerros medicaoindicador (cost=0.00..2,700.08 rows=135,004 width=64) (actual time=0.006..155.941 rows=135,003 loops=1)

11. 0.103 1.286 ↓ 1.0 311 1

Hash (cost=94.06..94.06 rows=306 width=18) (actual time=1.286..1.286 rows=311 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 26kB
12. 0.168 1.183 ↓ 1.0 311 1

Hash Join (cost=18.17..94.06 rows=306 width=18) (actual time=0.302..1.183 rows=311 loops=1)

  • Hash Cond: (indicador.classificacaoinvestimentoid = classificacaoinvestimento.id)
13. 0.177 0.946 ↓ 1.0 311 1

Hash Join (cost=13.63..85.31 rows=306 width=26) (actual time=0.229..0.946 rows=311 loops=1)

  • Hash Cond: (indicador.classificacaoramoatividadeid = classificacaoramoatividade.id)
14. 0.163 0.701 ↓ 1.0 311 1

Hash Join (cost=9.09..76.56 rows=306 width=34) (actual time=0.157..0.701 rows=311 loops=1)

  • Hash Cond: (indicador.classificacaogestaoid = classificacaogestao.id)
15. 0.262 0.474 ↓ 1.0 311 1

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

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

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

17. 0.043 0.067 ↓ 1.1 119 1

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

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

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

19. 0.035 0.064 ↓ 1.1 119 1

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

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

Seq Scan on classificacaoindicador classificacaogestao (cost=0.00..3.13 rows=113 width=8) (actual time=0.002..0.029 rows=119 loops=1)

21. 0.032 0.068 ↓ 1.1 119 1

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

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

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

23. 0.028 0.069 ↓ 1.1 119 1

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

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

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

25. 0.287 1.271 ↑ 1.1 947 1

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

  • Buckets: 2048 Batches: 1 Memory Usage: 61kB
26. 0.577 0.984 ↑ 1.1 947 1

Hash Join (cost=8.13..43.41 rows=1,037 width=16) (actual time=0.178..0.984 rows=947 loops=1)

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

Seq Scan on unidadenegocio (cost=0.00..22.37 rows=1,037 width=24) (actual time=0.008..0.244 rows=947 loops=1)

28. 0.071 0.163 ↓ 1.2 269 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 19kB
29. 0.092 0.092 ↓ 1.2 269 1

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