Re: [GENERAL] Equivalence Classes when using IN - Mailing list pgsql-general

From David Rowley
Subject Re: [GENERAL] Equivalence Classes when using IN
Date
Msg-id CAKJS1f96SVOb64cF2=w5cCL9zY2k5+WwRxUVOgfazCZ=Z=M1BA@mail.gmail.com
Whole thread Raw
In response to Re: [GENERAL] Equivalence Classes when using IN  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
On 10 October 2017 at 12:44, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> David Rowley <david.rowley@2ndquadrant.com> writes:
>> If the only reason that is_simple_subquery() rejects subqueries with
>> ORDER BY is due to wanting to keep the order by of a view, then
>> couldn't we make is_simple_subquery() a bit smarter and have it check
>> if the subquery is going to be joined to something else, which likely
>> would destroy the order, or at least it would remove any guarantees of
>> it.
>
> I'm not on board with this.  The assumption is that if the user put an
> ORDER BY there, that means they want that subquery to be computed in that
> order.  It's not for us to decide they didn't mean what they said.
>
> Moreover, there are cases where the ORDER BY would be semantically
> significant, eg if there's a LIMIT or volatile functions or tSRFs
> involved.

Ok, thanks for looking, although, FWIW, LIMIT and tSRFs are still disabled.


-- David Rowley                   http://www.2ndQuadrant.com/PostgreSQL Development, 24x7 Support, Training & Services


-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: [GENERAL] Equivalence Classes when using IN
Next
From: Tom Lane
Date:
Subject: Re: [GENERAL] startup process stuck in recovery