explain.depesz.com

PostgreSQL's explain analyze made readable

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

Settings

Optimization path:

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 100.052 579.593 ↓ 1.1 57,086 1

Hash Join (cost=14,790.62..67,242.95 rows=54,335 width=194) (actual time=270.811..579.593 rows=57,086 loops=1)

  • Hash Cond: (d.id_episodio = e.id)
2. 311.892 329.780 ↓ 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=120.998..329.780 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
3. 17.888 17.888 ↓ 1.0 111,992 1

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

  • Index Cond: (id_medicamento = 24117)
4. 25.145 149.761 ↑ 1.0 31,844 1

Hash (cost=11,481.20..11,481.20 rows=31,844 width=194) (actual time=149.761..149.761 rows=31,844 loops=1)

  • Buckets: 32768 Batches: 2 Memory Usage: 3957kB
5. 124.616 124.616 ↑ 1.0 31,844 1

Seq Scan on episodios_cache_nf e (cost=0.00..11,481.20 rows=31,844 width=194) (actual time=0.023..124.616 rows=31,844 loops=1)

  • Filter: episodio_base
  • Rows Removed by Filter: 127376
Planning time : 1.277 ms
Execution time : 585.453 ms