explain.depesz.com

PostgreSQL's explain analyze made readable

Result: SP2B : Optimization for: Optimization for: Optimization for: Optimization for: Optimization for: Optimization for: plan #cjH6; plan #RIdw; plan #VE6w; plan #VneM; plan #qJ5E; plan #J4aT

Settings

Optimization path:

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 97.563 566.311 ↓ 1.1 57,086 1

Hash Join (cost=15,182.69..67,628.30 rows=54,064 width=194) (actual time=272.643..566.311 rows=57,086 loops=1)

  • Hash Cond: (d.id_episodio = e.id)
2. 299.910 321.741 ↓ 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=125.559..321.741 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. 21.831 21.831 ↓ 1.0 111,992 1

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

  • Index Cond: (id_medicamento = 24117)
4. 31.353 147.007 ↓ 1.0 31,844 1

Hash (cost=11,879.25..11,879.25 rows=31,685 width=194) (actual time=147.007..147.007 rows=31,844 loops=1)

  • Buckets: 32768 Batches: 2 Memory Usage: 3957kB
5. 115.654 115.654 ↓ 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.013..115.654 rows=31,844 loops=1)

  • Filter: (id_norma = 1)
  • Rows Removed by Filter: 127376
Planning time : 0.762 ms
Execution time : 572.301 ms