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

From Kyotaro Horiguchi
Subject Re: FETCH FIRST clause PERCENT option
Date
Msg-id 20200117.152008.415372908548273693.horikyota.ntt@gmail.com
Whole thread Raw
In response to Re: FETCH FIRST clause PERCENT option  (Tomas Vondra <tomas.vondra@2ndquadrant.com>)
Responses Re: FETCH FIRST clause PERCENT option  (Vik Fearing <vik.fearing@2ndquadrant.com>)
List pgsql-hackers
Thank you for the notification, Tomas.

At Thu, 16 Jan 2020 22:33:58 +0100, Tomas Vondra <tomas.vondra@2ndquadrant.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..

regards.

-- 
Kyotaro Horiguchi
NTT Open Source Software Center



pgsql-hackers by date:

Previous
From: Pengzhou Tang
Date:
Subject: Re: Errors when update a view with conditional-INSTEAD rules
Next
From: Pavel Stehule
Date:
Subject: Re: SQL/JSON: functions