explain.depesz.com

PostgreSQL's explain analyze made readable

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

Settings

Optimization path:

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 120.282 830.958 ↓ 1.3 57,086 1

Gather Merge (cost=69,705.59..74,962.25 rows=45,054 width=194) (actual time=709.078..830.958 rows=57,086 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
2. 82.518 710.676 ↑ 1.2 19,029 3 / 3

Sort (cost=68,705.56..68,761.88 rows=22,527 width=194) (actual time=697.786..710.676 rows=19,029 loops=3)

  • Sort Key: e.alta
  • Sort Method: external merge Disk: 5512kB
3. 69.010 628.158 ↑ 1.2 19,029 3 / 3

Hash Join (cost=15,580.74..64,920.93 rows=22,527 width=194) (actual time=383.454..628.158 rows=19,029 loops=3)

  • Hash Cond: (d.id_episodio = e.id)
4. 284.894 293.834 ↑ 1.2 19,029 3 / 3

Parallel Bitmap Heap Scan on dispensaciones_cache d (cost=2,040.37..49,289.90 rows=22,632 width=4) (actual time=117.639..293.834 rows=19,029 loops=3)

  • Recheck Cond: (id_medicamento = 24117)
  • Filter: ((administraciond_normalizada >= 20180101) AND (administraciond_normalizada <= 20181231))
  • Rows Removed by Filter: 18302
  • Heap Blocks: exact=20641
5. 8.940 8.940 ↓ 1.0 111,992 1 / 3

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

  • Index Cond: (id_medicamento = 24117)
6. 50.148 265.314 ↓ 1.0 31,844 3 / 3

Hash (cost=12,277.30..12,277.30 rows=31,685 width=194) (actual time=265.314..265.314 rows=31,844 loops=3)

  • Buckets: 32768 Batches: 2 Memory Usage: 3957kB
7. 215.166 215.166 ↓ 1.0 31,844 3 / 3

Seq Scan on episodios_cache_nf e (cost=0.00..12,277.30 rows=31,685 width=194) (actual time=0.024..215.166 rows=31,844 loops=3)

  • Filter: ((id_hospital = 290) AND (id_norma = 1))
  • Rows Removed by Filter: 127376
Planning time : 3.179 ms
Execution time : 838.858 ms