Re: any way for ORDER BY x to imply NULLS FIRST in 8.3?

From: Tomas Vondra <tv(at)fuzzy(dot)cz>
To:
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: any way for ORDER BY x to imply NULLS FIRST in 8.3?
Date: 2007-11-08 01:15:42
Message-ID: 4732633E.9080704@fuzzy.cz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

> Reece Hart <reece(at)harts(dot)net> writes:
>> However, it's not clear that you've considered a clause like 'ORDER BY
>> (foo IS NULL), foo', which I believe is not implementation dependent.
>
> Yeah, that should work reasonably portably ... where "portable" means
> "equally lousy performance in every implementation", unfortunately :-(.
> I rather doubt that many implementations will see through that to decide
> that they can avoid an explicit sort.

Well, an index on ((foo IS NULL), foo) might improve the performance
when sorting along these columns, but sure it's not a cure-all. And you
still have to modify the SQL and the database schema ...

regards
TV

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2007-11-08 01:15:59 Re: System V IPC on Windows
Previous Message Tom Lane 2007-11-08 01:08:57 Re: Recovering / undoing transactions?