Re: FETCH FIRST clause PERCENT option

From: Andrew Gierth <andrew(at)tao11(dot)riddles(dot)org(dot)uk>
To: Andres Freund <andres(at)anarazel(dot)de>
Cc: Surafel Temesgen <surafel3000(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: FETCH FIRST clause PERCENT option
Date: 2018-08-16 14:52:06
Message-ID: 8736ve4bea.fsf@news-spur.riddles.org.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

>>>>> "Andres" == Andres Freund <andres(at)anarazel(dot)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)

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Mark Dilger 2018-08-16 14:54:13 Re: Facility for detecting insecure object naming
Previous Message Bruce Momjian 2018-08-16 14:35:01 Problem with OpenSCG downloads