explain.depesz.com

PostgreSQL's explain analyze made readable

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

# exclusive inclusive rows x rows loops node
1. 181.615 817.586 ↓ 1.3 57,086 1

Gather Merge (cost=69,057.81..74,340.84 rows=45,280 width=194) (actual time=651.489..817.586 rows=57,086 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
2. 71.460 635.971 ↑ 1.2 19,029 3 / 3

Sort (cost=68,057.78..68,114.38 rows=22,640 width=194) (actual time=625.009..635.971 rows=19,029 loops=3)

  • Sort Key: e.alta
  • Sort Method: external merge Disk: 5200kB
3. 52.108 564.511 ↑ 1.2 19,029 3 / 3

Hash Join (cost=14,790.62..64,250.17 rows=22,640 width=194) (actual time=362.263..564.511 rows=19,029 loops=3)

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

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

  • Recheck Cond: (id_medicamento = 24117)
  • Filter: ((administraciond_normalizada >= 20180101) AND (administraciond_normalizada <= 20181231) AND (id_hospital = 290))
  • Rows Removed by Filter: 18302
  • Heap Blocks: exact=18326
5. 11.649 11.649 ↓ 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=34.947..34.947 rows=111,992 loops=1)

  • Index Cond: (id_medicamento = 24117)
6. 42.380 241.976 ↑ 1.0 31,844 3 / 3

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

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

Seq Scan on episodios_cache_nf e (cost=0.00..11,481.20 rows=31,844 width=194) (actual time=0.041..199.596 rows=31,844 loops=3)

  • Filter: episodio_base
  • Rows Removed by Filter: 127376
Planning time : 0.802 ms
Execution time : 826.680 ms