Re: Implement targetlist SRFs using ROWS FROM() (was Changed SRF in targetlist handling) - Mailing list pgsql-hackers

From Kevin Grittner
Subject Re: Implement targetlist SRFs using ROWS FROM() (was Changed SRF in targetlist handling)
Date
Msg-id CACjxUsM7PUBF3_u-+J7j1WsoRZ9OVNTw2+=P15t2pqnv7utktQ@mail.gmail.com
Whole thread Raw
In response to Re: Implement targetlist SRFs using ROWS FROM() (was Changed SRF in targetlist handling)  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: Implement targetlist SRFs using ROWS FROM() (was Changed SRF in targetlist handling)  (Andres Freund <andres@anarazel.de>)
List pgsql-hackers
On Fri, Sep 2, 2016 at 3:31 AM, Robert Haas <robertmhaas@gmail.com> wrote:
> On Tue, Aug 23, 2016 at 3:10 AM, Andres Freund <andres@anarazel.de> wrote:

>> =# SELECT * FROM few, ROWS FROM(generate_series(1,3));
>> ┌────┬─────────────────┐
>> │ id │ generate_series │
>> ├────┼─────────────────┤
>> │  1 │               1 │
>> │  2 │               1 │
>> │  1 │               2 │
>> │  2 │               2 │
>> │  1 │               3 │
>> │  2 │               3 │
>> └────┴─────────────────┘
>> (6 rows)
>> surely isn't what was intended.  So the join order needs to be enforced.
>
> In general, we've been skeptical about giving any guarantees about
> result ordering.

+1

I think it is a very bad idea to move away from the statement that
a query generates a set of rows, and that no order is guaranteed
unless the top level has an ORDER BY clause.  How hard is it to add
ORDER BY 1, 2 to the above query?  Let the optimizer notice when a
node returns data in the needed order and skip the sort if possible.

--
Kevin Grittner
EDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Password identifiers, protocol aging and SCRAM protocol
Next
From: Jesper Pedersen
Date:
Subject: Re: Cache Hash Index meta page.