explain.depesz.com

PostgreSQL's explain analyze made readable

Result: voOe : Optimization for: Optimization for: original; plan #R81y; plan #HRzk

Settings

Optimization path:

# exclusive inclusive rows x rows loops node
1. 0.199 462.046 ↑ 1.0 600 1

Limit (cost=31,670.06..38,562.37 rows=600 width=164) (actual time=380.666..462.046 rows=600 loops=1)

2. 70.419 461.847 ↑ 33,868.6 600 1

Hash Left Join (cost=31,670.06..233,464,892.84 rows=20,321,189 width=164) (actual time=380.664..461.847 rows=600 loops=1)

  • Hash Cond: (b.numero_prontuario = (c.numero_prontuario)::numeric)
3. 54.108 79.795 ↑ 1,144.6 2,340 1

Hash Left Join (cost=24.17..147,182.84 rows=2,678,448 width=75) (actual time=67.624..79.795 rows=2,340 loops=1)

  • Hash Cond: (translate(translate((b.nome_setor)::text, ';./\¨-_*?,()[]{}@#$%"&'::text, ' '::text), 'áàãââÁÀÃÂéêÉÊíÍóõôÓÔÕúüÚÜçÇ'::text, 'aaaaaAAAAeeEEiIoooOOOuuUUcC'::text) = (sa.nome)::text)
4. 22.324 25.627 ↑ 1,144.6 2,340 1

Hash Left Join (cost=11.92..117,038.05 rows=2,678,448 width=71) (actual time=22.671..25.627 rows=2,340 loops=1)

  • Hash Cond: ((b.tipo_atendimento)::text = (ta.descricao)::text)
5. 1.222 2.449 ↑ 1,144.6 2,340 1

Hash Left Join (cost=10.90..106,580.78 rows=2,678,448 width=67) (actual time=0.064..2.449 rows=2,340 loops=1)

  • Hash Cond: (b."ISN" = ba.isn)
6. 1.221 1.221 ↑ 1,144.6 2,340 1

Seq Scan on tb_boletim_atendimento b (cost=0.00..72,754.48 rows=2,678,448 width=63) (actual time=0.019..1.221 rows=2,340 loops=1)

7. 0.000 0.006 ↓ 0.0 0 1

Hash (cost=10.40..10.40 rows=40 width=8) (actual time=0.006..0.006 rows=0 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 8kB
8. 0.006 0.006 ↓ 0.0 0 1

Seq Scan on tb_boletim_atendimento ba (cost=0.00..10.40 rows=40 width=8) (actual time=0.006..0.006 rows=0 loops=1)

9. 0.829 0.854 ↑ 1.0 1 1

Hash (cost=1.01..1.01 rows=1 width=222) (actual time=0.854..0.854 rows=1 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
10. 0.025 0.025 ↑ 1.0 1 1

Seq Scan on tb_tipo_atendimento ta (cost=0.00..1.01 rows=1 width=222) (actual time=0.023..0.025 rows=1 loops=1)

11. 0.008 0.060 ↑ 100.0 1 1

Hash (cost=11.00..11.00 rows=100 width=222) (actual time=0.060..0.060 rows=1 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
12. 0.052 0.052 ↑ 100.0 1 1

Seq Scan on tb_setor_atendimento sa (cost=0.00..11.00 rows=100 width=222) (actual time=0.050..0.052 rows=1 loops=1)

13. 174.924 311.633 ↑ 1.0 340,084 1

Hash (cost=24,404.84..24,404.84 rows=340,084 width=42) (actual time=311.633..311.633 rows=340,084 loops=1)

  • Buckets: 65536 Batches: 8 Memory Usage: 3727kB
14. 136.709 136.709 ↑ 1.0 340,084 1

Seq Scan on tb_migra_controle c (cost=0.00..24,404.84 rows=340,084 width=42) (actual time=0.012..136.709 rows=340,084 loops=1)

Planning time : 18.378 ms
Execution time : 477.262 ms