explain.depesz.com

PostgreSQL's explain analyze made readable

Result: L3V6 : Optimization for: Optimization for: Optimization for: Optimization for: plan #mWjY; plan #IrtJ; plan #wDLS; plan #l8Ca

Settings

Optimization path:

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 0.005 2,240.319 ↑ 1.0 10 1

Limit (cost=162,467.34..162,467.72 rows=10 width=12) (actual time=2,240.281..2,240.319 rows=10 loops=1)

2. 0.014 2,240.314 ↑ 16,809.1 10 1

Unique (cost=162,467.34..168,891.23 rows=168,091 width=12) (actual time=2,240.279..2,240.314 rows=10 loops=1)

3. 1,392.980 2,240.300 ↑ 15,026.6 57 1

Sort (cost=162,467.34..164,608.64 rows=856,519 width=12) (actual time=2,240.278..2,240.300 rows=57 loops=1)

  • Sort Key: coste_unidad_medicamento_mes DESC, id_medicamento
  • Sort Method: external merge Disk: 22,320kB
4. 847.320 847.320 ↓ 1.0 875,144 1

Seq Scan on dispensaciones_cache d (cost=0.00..63,424.92 rows=856,519 width=12) (actual time=213.623..847.320 rows=875,144 loops=1)

  • Filter: ((administraciond_normalizada >= 20,180,101) AND (administraciond_normalizada <= 20,181,231) AND (id_hospital = 290))
  • Rows Removed by Filter: 807,137
Planning time : 0.910 ms
Execution time : 2,245.264 ms