Re: Index not used with IS NULL - Mailing list pgsql-general

From Tom Lane
Subject Re: Index not used with IS NULL
Date
Msg-id 20888.1045544099@sss.pgh.pa.us
Whole thread Raw
In response to Re: Index not used with IS NULL  (Martijn van Oosterhout <kleptog@svana.org>)
Responses Re: Index not used with IS NULL  (Martijn van Oosterhout <kleptog@svana.org>)
List pgsql-general
Martijn van Oosterhout <kleptog@svana.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

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: Index not used with IS NULL
Next
From: Tom Lane
Date:
Subject: Re: TIMESTAMP WITH( OUT)? TIME ZONE indexing/type choice...