Re: IS NOT DISTINCT FROM + Indexing - Mailing list pgsql-hackers

From Tom Lane
Subject Re: IS NOT DISTINCT FROM + Indexing
Date
Msg-id 17764.1405993868@sss.pgh.pa.us
Whole thread Raw
In response to IS NOT DISTINCT FROM + Indexing  ("Jonathan S. Katz" <jonathan.katz@excoventures.com>)
Responses Re: IS NOT DISTINCT FROM + Indexing
List pgsql-hackers
"Jonathan S. Katz" <jonathan.katz@excoventures.com> writes:
> I'm curious if there is a reason why "IS NOT DISTINCT FROM" is not an
> indexable operation in a B-tree index,

The short reason why not is that it's not an operator (where "operator"
is defined as "something with a pg_operator entry"), and all our indexing
infrastructure is built around the notion that indexable clauses are of
the form "indexed_column indexable_operator comparison_value".

You could certainly imagine ways to fix that, but nobody's put in the
probably-nontrivial effort required to do so.  The btree code itself
would likely be the easiest part to fix, as it sort of thinks nulls
are real values already.
        regards, tom lane



pgsql-hackers by date:

Previous
From: "MauMau"
Date:
Subject: Re: [bug fix] Suppress "autovacuum: found orphan temp table" message
Next
From: Amit Kapila
Date:
Subject: Re: [BUGS] BUG #9652: inet types don't support min/max