explain.depesz.com

PostgreSQL's explain analyze made readable

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

Settings

Optimization path:

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 0.003 2,160.490 ↑ 1.0 10 1

Limit (cost=162,472.23..162,472.61 rows=10 width=12) (actual time=2,160.452..2,160.490 rows=10 loops=1)

2. 0.015 2,160.487 ↑ 16,809.8 10 1

Unique (cost=162,472.23..168,896.38 rows=168,098 width=12) (actual time=2,160.451..2,160.487 rows=10 loops=1)

3. 1,355.219 2,160.472 ↑ 15,027.3 57 1

Sort (cost=162,472.23..164,613.61 rows=856,554 width=12) (actual time=2,160.450..2,160.472 rows=57 loops=1)

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

Seq Scan on dispensaciones_cache d (cost=0.00..63,426.11 rows=856,554 width=12) (actual time=201.071..805.253 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.199 ms
Execution time : 2,167.154 ms