Re: Index not used with IS NULL

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Martijn van Oosterhout <kleptog(at)svana(dot)org>
Cc: Dmitry Tkach <dmitry(at)openratings(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: Index not used with IS NULL
Date: 2003-02-18 04:54:59
Message-ID: 20888.1045544099@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Martijn van Oosterhout <kleptog(at)svana(dot)org> writes:
> My Plan B was to create a operator IS (and its inverse ISNOT) which is then
> binary operator. It would be identical to =3D and <> except that it would be
> defined where either argument is NULL. Fiddle the parser to use this
> operator instead of the unary ISNULL.

I don't think there's anything fundamental that assumes that indexable
operators are binary, so you might as well make the operator unary. The
problem with this approach isn't that --- it's the tedium of making an
ISNULL operator for every datatype, adding it to every opclass, etc.

Maybe there's no non-kluge answer that doesn't make us buy into that,
but it sure seems like the hard way. It's definitely not going to be
a short and sweet patch :-(

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2003-02-18 05:04:21 Re: TIMESTAMP WITH( OUT)? TIME ZONE indexing/type choice...
Previous Message Tom Lane 2003-02-18 04:44:59 Re: Index not used with IS NULL