Re: FETCH FIRST clause WITH TIES option - Mailing list pgsql-hackers

From Tomas Vondra
Subject Re: FETCH FIRST clause WITH TIES option
Date
Msg-id 65ecc991-97aa-50a2-7131-10c8b3991c8c@2ndquadrant.com
Whole thread Raw
In response to Re: FETCH FIRST clause WITH TIES option  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: FETCH FIRST clause WITH TIES option  (Surafel Temesgen <surafel3000@gmail.com>)
List pgsql-hackers
On 10/31/2018 06:17 PM, Robert Haas wrote:
> On Mon, Oct 29, 2018 at 12:48 PM Andrew Gierth
> <andrew@tao11.riddles.org.uk> wrote:
>> Then FETCH FIRST N WITH TIES becomes "stop when the expression
>>    rank() over (order by ...) <= N
>> is no longer true" (where the ... is the existing top level order by)
> 
> Wouldn't that be wicked expensive compared to something hard-coded
> that does the same thing?
> 

Not sure, but that was one of my concerns too, particularly for the 
simple FETCH FIRST N WITH TIES case. But I think Andrew has a point it 
would make it much easier to implement the PERCENT case.

regards

-- 
Tomas Vondra                  http://www.2ndQuadrant.com
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services


pgsql-hackers by date:

Previous
From: Amit Kapila
Date:
Subject: Re: pg_promote not marked as parallel-restricted in pg_proc.dat
Next
From: Alexander Kukushkin
Date:
Subject: Re: Connection slots reserved for replication