On Mon, 2024-05-20 at 13:08 +0200, Sašo Gantar wrote: [execution plan without query text or explanation] The time is lost here: -> WindowAgg (cost=310.01..358.34 rows=537 width=888) (actual time=0.057..19.955 rows=473 loops=401) Buffers: shared hit=1710825 Yours, Laurenz Albe