Re: FETCH FIRST clause PERCENT option

From: Vik Fearing <vik(dot)fearing(at)2ndquadrant(dot)com>
To: Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com>, tomas(dot)vondra(at)2ndquadrant(dot)com
Cc: ryan(at)rustprooflabs(dot)com, pgsql-hackers(at)lists(dot)postgresql(dot)org, surafel3000(at)gmail(dot)com
Subject: Re: FETCH FIRST clause PERCENT option
Date: 2020-01-17 08:13:06
Message-ID: c1d5ee1b-4991-1a5e-8d0c-d153aab6a367@2ndquadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 17/01/2020 07:20, Kyotaro Horiguchi wrote:
> Thank you for the notification, Tomas.
>
> At Thu, 16 Jan 2020 22:33:58 +0100, Tomas Vondra <tomas(dot)vondra(at)2ndquadrant(dot)com> wrote in
>> This patch is marked as RFC since September. Since then there was no
>> discussion on this thread, but Andrew proposed an alternative approach
>> based on window functions in a separate thread [1] (both for this and
>> for the WITH TIES case).
>>
>> I'll set this patch back to "needs review" - at this point we need to
>> decide which of the approaches is the right one.
> Even consdiering that we have only two usage , WITH TIES and PERCENT,
> of the mechanism for now, I like [1] for the generic nature,
> simpleness and smaller invasiveness to executor. The fact that cursor
> needs materialize to allow backward scan would not be a big problem.
> It seems that PERCENT will be easily implemented on that.
>
> However, isn't there a possibility that we allow FETCH FIRST x PERCENT
> WITH TIES, though I'm not sure what SQL spec tells about that? I
> don't come up right now how to do that using window functions..

PERCENT and WITH TIES can play together, per spec.

--

Vik Fearing

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Yugo NAGATA 2020-01-17 08:21:18 Re: Implementing Incremental View Maintenance
Previous Message Yugo NAGATA 2020-01-17 08:11:53 Re: Implementing Incremental View Maintenance