explain.depesz.com

A tool for finding a real cause for slow queries.

Result: 1p8

options
Did it help? Consider supporting us - Bitcoin address: 12v2hUztAk2LgzQ9H9LMwuU32urHMjZQnq
# exclusive inclusive rows x rows loops node
1. 2,248.848 13,404.220 ↓ 1.0 4,940,187 1

WindowAgg (cost=1,386,642.46..1,484,952.48 rows=4,915,501 width=12) (actual time=10,761.814..13,404.220 rows=4,940,187 loops=1)

2.          

CTE ranking

3. 2,635.905 7,076.647 ↓ 1.0 4,940,187 1

WindowAgg (cost=655,980.09..742,001.36 rows=4,915,501 width=22) (actual time=3,601.696..7,076.647 rows=4,940,187 loops=1)

4. 3,568.626 4,440.742 ↓ 1.0 4,940,187 1

Sort (cost=655,980.09..668,268.85 rows=4,915,501 width=22) (actual time=3,601.684..4,440.742 rows=4,940,187 loops=1)

  • Sort Key: tmp_cluster_de.cid
  • Sort Method: quicksort Memory: 582561kB
5. 872.116 872.116 ↓ 1.0 4,940,187 1

Seq Scan on tmp_cluster_de (cost=0.00..109,649.02 rows=4,915,501 width=22) (actual time=0.009..872.116 rows=4,940,187 loops=1)

  • Filter: (cid IS NOT NULL)
6. 2,611.138 11,155.372 ↓ 1.0 4,940,187 1

Sort (cost=644,641.09..656,929.85 rows=4,915,501 width=12) (actual time=10,761.804..11,155.372 rows=4,940,187 loops=1)

  • Sort Key: ranking.sub_cluster_id, ranking.cluster_id
  • Sort Method: quicksort Memory: 428180kB
7. 8,544.234 8,544.234 ↓ 1.0 4,940,187 1

CTE Scan on ranking (cost=0.00..98,310.02 rows=4,915,501 width=12) (actual time=3,601.699..8,544.234 rows=4,940,187 loops=1)