explain.depesz.com

PostgreSQL's explain analyze made readable

Result: rqFTR

Settings

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 2.518 748.164 ↑ 1.0 2,183 1

WindowAgg (cost=50,110.06..50,148.26 rows=2,183 width=44) (actual time=745.263..748.164 rows=2,183 loops=1)

2. 3.688 745.646 ↑ 1.0 2,183 1

Sort (cost=50,110.06..50,115.51 rows=2,183 width=36) (actual time=745.254..745.646 rows=2,183 loops=1)

  • Sort Key: (sum(dispensaciones)) DESC
  • Sort Method: quicksort Memory: 199kB
3. 7.383 741.958 ↑ 1.0 2,183 1

Finalize GroupAggregate (cost=49,918.04..49,988.98 rows=2,183 width=36) (actual time=733.565..741.958 rows=2,183 loops=1)

  • Group Key: id_medicamento
4. 6.525 734.575 ↓ 1.5 6,549 1

Sort (cost=49,918.04..49,928.95 rows=4,366 width=36) (actual time=733.535..734.575 rows=6,549 loops=1)

  • Sort Key: id_medicamento
  • Sort Method: quicksort Memory: 704kB
5. 11.636 728.050 ↓ 1.5 6,549 1

Gather (cost=49,190.18..49,654.07 rows=4,366 width=36) (actual time=721.463..728.050 rows=6,549 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
6. 243.158 716.414 ↑ 1.0 2,183 3 / 3

Partial HashAggregate (cost=48,190.18..48,217.47 rows=2,183 width=36) (actual time=713.780..716.414 rows=2,183 loops=3)

  • Group Key: id_medicamento
7. 473.256 473.256 ↑ 1.2 298,598 3 / 3

Parallel Seq Scan on dispensaciones_cache d (cost=0.00..46,386.66 rows=360,704 width=12) (actual time=111.876..473.256 rows=298,598 loops=3)

  • Filter: ((administraciond_normalizada >= 20,180,101) AND (administraciond_normalizada <= 20,181,231) AND (id_hospital = 290))
  • Rows Removed by Filter: 287,230
Planning time : 0.292 ms
Execution time : 748.632 ms