Re: Does anybody use ORDER BY x USING y? - Mailing list pgsql-hackers

From Martijn van Oosterhout
Subject Re: Does anybody use ORDER BY x USING y?
Date
Msg-id 20050919092402.GC18456@svana.org
Whole thread Raw
In response to Re: Does anybody use ORDER BY x USING y?  (Hannu Krosing <hannu@skype.net>)
Responses Re: Does anybody use ORDER BY x USING y?
List pgsql-hackers
On Mon, Sep 19, 2005 at 11:13:05AM +0300, Hannu Krosing wrote:
> > (1) IS NULL is not an indexable operation, so no, not without
> > significant overhaul of the index AM API.
>
> But we do store NULLs in indexes, so why is it not indexable?
>
> This is either an interface bug (not making use of stored info) or
> storage bug (wasting space storing unneccessary info)

Err, indexes used to not store NULLs to save space. However, it turns
out that SQL UNIQUE has something to say about NULLs in unique columns
so they had to be included.

However, the machinary to decide if an index is usable assumes that
usable operators have two arguments and IS NULL isn't really an
operator in the PostgreSQL sense and doesn't have two arguments either.

*If* that can be fixed, then we can be more flexible. But if it were
easy it would have been done long ago...

Have a nice day,
--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> Patent. n. Genius is 5% inspiration and 95% perspiration. A patent is a
> tool for doing 5% of the work and then sitting around waiting for someone
> else to do the other 95% so you can sue them.

pgsql-hackers by date:

Previous
From: "Magnus Hagander"
Date:
Subject: Re: Beta2 Wrap Up ...
Next
From: Hannu Krosing
Date:
Subject: Re: Does anybody use ORDER BY x USING y?