explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 5Eo8 : Optimization for: Optimization for: Optimization for: Optimization for: Optimization for: Optimization for: Optimization for: Optimization for: Optimization for: plan #cjH6; plan #RIdw; plan #VE6w; plan #VneM; plan #qJ5E; plan #J4aT; plan #SP2B; plan #tkVV; plan #o7K96

Settings

Optimization path:

# exclusive inclusive rows x rows loops node
1. 34.347 494.134 ↑ 1.1 22,514 1

Hash Join (cost=52,027.23..62,687.90 rows=25,832 width=194) (actual time=396.592..494.134 rows=22,514 loops=1)

  • Hash Cond: (e.id = d.id_episodio)
2. 67.253 75.663 ↑ 1.0 31,844 1

Bitmap Heap Scan on episodios_cache_nf e (cost=696.57..10,985.80 rows=32,019 width=194) (actual time=12.426..75.663 rows=31,844 loops=1)

  • Recheck Cond: (id_norma = 1)
  • Heap Blocks: exact=9754
3. 8.410 8.410 ↓ 1.2 39,368 1

Bitmap Index Scan on norma_nf (cost=0.00..688.56 rows=32,019 width=0) (actual time=8.410..8.410 rows=39,368 loops=1)

  • Index Cond: (id_norma = 1)
4. 7.125 384.124 ↑ 1.0 22,514 1

Hash (cost=51,046.49..51,046.49 rows=22,734 width=4) (actual time=384.124..384.124 rows=22,514 loops=1)

  • Buckets: 32768 Batches: 1 Memory Usage: 1048kB
5. 45.924 376.999 ↑ 1.0 22,514 1

HashAggregate (cost=50,819.15..51,046.49 rows=22,734 width=4) (actual time=369.529..376.999 rows=22,514 loops=1)

  • Group Key: d.id_episodio
6. 310.906 331.075 ↓ 1.1 57,086 1

Bitmap Heap Scan on dispensaciones_cache d (cost=2,040.37..50,683.35 rows=54,317 width=4) (actual time=128.594..331.075 rows=57,086 loops=1)

  • Recheck Cond: (id_medicamento = 24117)
  • Filter: ((administraciond_normalizada >= 20180101) AND (administraciond_normalizada <= 20181231) AND (id_hospital = 290))
  • Rows Removed by Filter: 54906
  • Heap Blocks: exact=42662
7. 20.169 20.169 ↓ 1.0 111,992 1

Bitmap Index Scan on dispensacion_medicamento (cost=0.00..2,026.79 rows=109,649 width=0) (actual time=20.169..20.169 rows=111,992 loops=1)

  • Index Cond: (id_medicamento = 24117)
Planning time : 1.120 ms
Execution time : 497.145 ms