From: Gurjeet Singh <singh.gurjeet@gmail.com>
To: Harald Fuchs <hf1110x@protecting.net>
Cc: pgsql-general@postgresql.org
Subject: Re: ORDER BY
Date: Tue, 21 Nov 2006 08:35:34 +0530
Message-ID: <65937bea0611201905v3f5adf02r254d82cc6d26f641@mail.gmail.com> (raw)
In-Reply-To: <pupsbn3dy8.fsf@srv.protecting.net>
References: <1163541820.580520.110310@k70g2000cwa.googlegroups.com>
<DFDFB8FE-1787-4508-97C4-5FD12357936A@purefiction.net>
<pupsbn3dy8.fsf@srv.protecting.net>
On 16 Nov 2006 11:04:15 +0100, Harald Fuchs <hf1110x@protecting.net> wrote:
>
> Why so complicated?
>
> SELECT whatever FROM foo ORDER BY name = 'Other', name
>
This is by far the simplest (and intelligent) of them all. And it will use a
single scan of the underlying table (or index, if used), so should prove to
be faster than the other UNION schemes.
Another tweak: If possible, use the integer column (ID) instead of the Name
column.
Regards,
--
gurjeet[.singh]@EnterpriseDB.com
singh.gurjeet@{ gmail | hotmail | yahoo }.com
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: singh.gurjeet@gmail.com, hf1110x@protecting.net
Subject: Re: ORDER BY
In-Reply-To: <65937bea0611201905v3f5adf02r254d82cc6d26f641@mail.gmail.com>
References: <1163541820.580520.110310@k70g2000cwa.googlegroups.com> <DFDFB8FE-1787-4508-97C4-5FD12357936A@purefiction.net> <pupsbn3dy8.fsf@srv.protecting.net> <65937bea0611201905v3f5adf02r254d82cc6d26f641@mail.gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox