explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 0zWb

Settings
# exclusive inclusive rows x rows loops node
1. 2.816 968.573 ↑ 1.0 2,183 1

WindowAgg (cost=51,935.41..51,973.61 rows=2,183 width=52) (actual time=965.489..968.573 rows=2,183 loops=1)

2. 2.392 965.757 ↑ 1.0 2,183 1

Sort (cost=51,935.41..51,940.86 rows=2,183 width=44) (actual time=965.483..965.757 rows=2,183 loops=1)

  • Sort Key: (sum(dispensaciones)) DESC
  • Sort Method: quicksort Memory: 267kB
3. 12.741 963.365 ↑ 1.0 2,183 1

Finalize GroupAggregate (cost=51,721.56..51,814.33 rows=2,183 width=44) (actual time=948.401..963.365 rows=2,183 loops=1)

  • Group Key: id_medicamento
4. 8.127 950.624 ↓ 1.5 6,549 1

Sort (cost=51,721.56..51,732.47 rows=4,366 width=44) (actual time=948.379..950.624 rows=6,549 loops=1)

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

Gather (cost=50,993.70..51,457.59 rows=4,366 width=44) (actual time=932.260..942.497 rows=6,549 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
6. 361.483 929.686 ↑ 1.0 2,183 3 / 3

Partial HashAggregate (cost=49,993.70..50,020.99 rows=2,183 width=44) (actual time=925.359..929.686 rows=2,183 loops=3)

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

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

  • Filter: ((administraciond_normalizada >= 20180101) AND (administraciond_normalizada <= 20181231) AND (id_hospital = 290))
  • Rows Removed by Filter: 287230
Planning time : 0.209 ms
Execution time : 969.088 ms