Thank you for the notification, Tomas. At Thu, 16 Jan 2020 22:33:58 +0100, Tomas Vondra <tomas.von...@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