Re: Patch to add functionality to specify ORDER BY in CREATE FUNCTION for SRFs

From: Atri Sharma <atri(dot)jiit(at)gmail(dot)com>
To: Amit Langote <Langote_Amit_f8(at)lab(dot)ntt(dot)co(dot)jp>
Cc: Ashutosh Bapat <ashutosh(dot)bapat(at)enterprisedb(dot)com>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Patch to add functionality to specify ORDER BY in CREATE FUNCTION for SRFs
Date: 2015-01-06 07:08:50
Message-ID: CAOeZVidx+0ib3k1xmSA_A7OF44-qF1zhdpDauVhR1e7CFF7ypA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Jan 6, 2015 at 12:29 PM, Amit Langote <Langote_Amit_f8(at)lab(dot)ntt(dot)co(dot)jp
> wrote:

> On 06-01-2015 PM 04:00, Ashutosh Bapat wrote:
> > On Tue, Jan 6, 2015 at 12:23 PM, Atri Sharma <atri(dot)jiit(at)gmail(dot)com>
> wrote:
> >>> We can eliminate the new node and put onus or having the right order on
> >>> the user like we do with volatile setting of the function.
> >>>
> >>>
> >>
> >> That is exactly what the new node does, since we are not re sorting
> right
> >> now in case the order is wrong. Please see my explanation upthread,
> >> OrderCheck node's primary purpose is to check for a user error in the
> >> result rows order. The onus right now to give correct order is on user.
> >>
> >>
> > Even checking whether the output of the function is in the right order or
> > not, has its cost. I am suggesting that we can eliminate this cost as
> well.
> > For example, PostgreSQL does not check whether a function is really
> > immutable or not.
> >
>
> Sounds something like ORDERED BY x implying output is "known" ordered by
> x perhaps enough hint for the planner to make necessary plan choices
> though I may be wrong.
>
>
>
I may be missing something, but isnt what you mentioned the exact
functionality this patch adds?

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Atri Sharma 2015-01-06 07:11:10 Re: Patch to add functionality to specify ORDER BY in CREATE FUNCTION for SRFs
Previous Message Ashutosh Bapat 2015-01-06 07:00:55 Re: Patch to add functionality to specify ORDER BY in CREATE FUNCTION for SRFs