explain.depesz.com

PostgreSQL's explain analyze made readable

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

Settings

Optimization path:

# exclusive inclusive rows x rows loops node
1. 0.087 754.664 ↑ 1.0 10 1

Limit (cost=50,768.78..50,768.80 rows=10 width=8) (actual time=754.577..754.664 rows=10 loops=1)

2. 0.606 754.577 ↑ 218.3 10 1

Sort (cost=50,768.78..50,774.23 rows=2,183 width=8) (actual time=754.576..754.577 rows=10 loops=1)

  • Sort Key: ((sum(coste_total_administradas) / sum(unidades_totales_administradas))) DESC
  • Sort Method: top-N heapsort Memory: 25kB
3. 2.968 753.971 ↑ 1.0 2,183 1

Finalize GroupAggregate (cost=50,650.66..50,721.60 rows=2,183 width=8) (actual time=750.162..753.971 rows=2,183 loops=1)

  • Group Key: id_medicamento
4. 4.286 751.003 ↓ 1.5 6,549 1

Sort (cost=50,650.66..50,661.57 rows=4,366 width=12) (actual time=750.145..751.003 rows=6,549 loops=1)

  • Sort Key: id_medicamento
  • Sort Method: quicksort Memory: 499kB
5. 8.692 746.717 ↓ 1.5 6,549 1

Gather (cost=49,928.25..50,386.68 rows=4,366 width=12) (actual time=739.416..746.717 rows=6,549 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
6. 260.830 738.025 ↑ 1.0 2,183 3 / 3

Partial HashAggregate (cost=48,928.25..48,950.08 rows=2,183 width=12) (actual time=736.922..738.025 rows=2,183 loops=3)

  • Group Key: id_medicamento
7. 477.195 477.195 ↑ 1.2 291,715 3 / 3

Parallel Seq Scan on dispensaciones_cache d (cost=0.00..46,251.63 rows=356,883 width=12) (actual time=120.950..477.195 rows=291,715 loops=3)

  • Filter: ((administraciond_normalizada >= 20,180,101) AND (administraciond_normalizada <= 20,181,231) AND (id_hospital = 290))
  • Rows Removed by Filter: 269,046
Planning time : 0.252 ms
Execution time : 754.754 ms