explain.depesz.com

PostgreSQL's explain analyze made readable

Result: CdNe : Does Postgres factorize the partition by sort among window functions?

Settings
# exclusive inclusive rows x rows loops node
1. 6,639.562 47,332.627 ↑ 1.0 10,000,002 1

WindowAgg (cost=4,416,434.22..4,616,434.26 rows=10,000,002 width=89) (actual time=38,607.631..47,332.627 rows=10,000,002 loops=1)

2. 11,568.390 40,693.065 ↑ 1.0 10,000,002 1

Sort (cost=4,416,434.22..4,441,434.23 rows=10,000,002 width=61) (actual time=38,607.607..40,693.065 rows=10,000,002 loops=1)

  • Sort Key: perf_entity_id, b_sourceid
  • Sort Method: external merge Disk: 447,968kB
3. 6,695.905 29,124.675 ↑ 1.0 10,000,002 1

WindowAgg (cost=2,301,805.10..2,501,805.14 rows=10,000,002 width=61) (actual time=18,745.726..29,124.675 rows=10,000,002 loops=1)

4. 13,318.739 22,428.770 ↑ 1.0 10,000,002 1

Sort (cost=2,301,805.10..2,326,805.11 rows=10,000,002 width=29) (actual time=18,745.704..22,428.770 rows=10,000,002 loops=1)

  • Sort Key: perf_entity_id, attr_ranking1
  • Sort Method: external merge Disk: 408,800kB
5. 9,110.031 9,110.031 ↑ 1.0 10,000,002 1

Seq Scan on mi_perf_entity s2 (cost=0.00..660,610.02 rows=10,000,002 width=29) (actual time=0.018..9,110.031 rows=10,000,002 loops=1)

Planning time : 0.104 ms
Execution time : 47,931.723 ms