Re: [RFE] auto ORDER BY for SELECT - Mailing list pgsql-general

From Andreas Kretschmer
Subject Re: [RFE] auto ORDER BY for SELECT
Date
Msg-id 20120123162619.GA3736@tux
Whole thread Raw
In response to [RFE] auto ORDER BY for SELECT  (Douglas Eric <sekkuar@hotmail.com>)
List pgsql-general
Douglas Eric <sekkuar@hotmail.com> wrote:

> I'm not sure if this is the right list to discuss this, but, I have a
> suggestion:
>
> ORDER BY clause, as defined in the SELECT documentation says:
>
> "If ORDER BY is not given, the rows are returned in whatever order the system
> finds fastest to produce"
>
> This order is usually not wanted, as it is not predictable. I believe many
> people would expect  the order of rows
> returned in this case, to be ordered as the primary key of the table, or the
> same order the rows were inserted.
>
> I suggest to change this behavior. If one makes a SELECT statement without any
> ORDER BY, it would be
> clever to automatically sort by the first primary key found in the query, if
> any.

No.

Since 8.3 (IIRC) we have a feature called 'concurrent seq. scan', see:
http://j-davis.com/postgresql/83v82_scans.html

Your suggestion can't work in this way. That's only one problem, there
are more.


Andreas
--
Really, I'm not out to destroy Microsoft. That will just be a completely
unintentional side effect.                              (Linus Torvalds)
"If I was god, I would recompile penguin with --enable-fly."   (unknown)
Kaufbach, Saxony, Germany, Europe.              N 51.05082°, E 13.56889°

pgsql-general by date:

Previous
From: Pavel Stehule
Date:
Subject: Re: [RFE] auto ORDER BY for SELECT
Next
From: "David Johnston"
Date:
Subject: Re: [RFE] auto ORDER BY for SELECT