explain.depesz.com

PostgreSQL's explain analyze made readable

Result: o7K96 : 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

Settings

Optimization path:

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 37.212 537.570 ↑ 1.1 22,514 1

Hash Join (cost=51,330.66..63,578.25 rows=25,633 width=194) (actual time=382.505..537.570 rows=22,514 loops=1)

  • Hash Cond: (e.id = d.id_episodio)
2. 117.984 117.984 ↓ 1.0 31,844 1

Seq Scan on episodios_cache_nf e (cost=0.00..11,879.25 rows=31,685 width=194) (actual time=0.018..117.984 rows=31,844 loops=1)

  • Filter: (id_norma = 1)
  • Rows Removed by Filter: 127376
3. 7.539 382.374 ↑ 1.0 22,514 1

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

  • Buckets: 32768 Batches: 1 Memory Usage: 1048kB
4. 44.328 374.835 ↑ 1.0 22,514 1

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

  • Group Key: d.id_episodio
5. 305.254 330.507 ↓ 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=129.751..330.507 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
6. 25.253 25.253 ↓ 1.0 111,992 1

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

  • Index Cond: (id_medicamento = 24117)
Planning time : 1.406 ms
Execution time : 540.389 ms