Re: [RFE] auto ORDER BY for SELECT

From: Andreas Kretschmer <akretschmer(at)spamfence(dot)net>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: [RFE] auto ORDER BY for SELECT
Date: 2012-01-23 16:26:19
Message-ID: 20120123162619.GA3736@tux
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Douglas Eric <sekkuar(at)hotmail(dot)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°

In response to

Browse pgsql-general by date

  From Date Subject
Next Message David Johnston 2012-01-23 16:32:41 Re: [RFE] auto ORDER BY for SELECT
Previous Message Pavel Stehule 2012-01-23 16:19:30 Re: [RFE] auto ORDER BY for SELECT