АС
имхо достаточно более чем
Size: a a a
АС
YS
YS
el
YS
el
el
DI
IA
ac
ac
el
ac
C
WindowAgg (cost=3032.60..3648.46 rows=30793 width=24)
-> Sort (cost=3032.60..3109.58 rows=30793 width=24)
Sort Key: profile_id, create_ts DESC"
-> Seq Scan on payment (cost=0.00..736.93 rows=30793 width=24)
ac
C
ac
C
SELECT idвот полностью explain:
FROM (select id, row_number() over (partition by profile_id order by create_ts desc) as pos from payment) AS partition
WHERE partition.pos <= 500;
Subquery Scan on partition (cost=3032.60..4033.37 rows=10264 width=8)
Filter: (partition.pos <= 500)
-> WindowAgg (cost=3032.60..3648.46 rows=30793 width=24)
-> Sort (cost=3032.60..3109.58 rows=30793 width=24)
Sort Key: payment.profile_id, payment.create_ts DESC"
-> Seq Scan on payment (cost=0.00..736.93 rows=30793 width=24)
ac
ac