Re: FETCH FIRST clause PERCENT option - Mailing list pgsql-hackers

From Andrew Gierth
Subject Re: FETCH FIRST clause PERCENT option
Date
Msg-id 8736ve4bea.fsf@news-spur.riddles.org.uk
Whole thread Raw
In response to Re: FETCH FIRST clause PERCENT option  (Andres Freund <andres@anarazel.de>)
List pgsql-hackers
>>>>> "Andres" == Andres Freund <andres@anarazel.de> writes:

 Andres> I think you'd have to instead spill the query results into a
 Andres> tuplestore (like we do for FOR HOLD queries at end of xact),
 Andres> and then do the computations based on that.

The approach I've suggested to some people who wanted to look into this
was to inject a window function call into the query, and teach the Limit
node to be able to stop on a boolean condition (which would be based on
that function result). This method should also work for WITH TIES by
using a different window function.

-- 
Andrew (irc:RhodiumToad)


pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: Re: FETCH FIRST clause PERCENT option
Next
From: Mark Dilger
Date:
Subject: Re: Facility for detecting insecure object naming