Re: IS NOT DISTINCT FROM + Indexing

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Jonathan S(dot) Katz" <jonathan(dot)katz(at)excoventures(dot)com>
Cc: Pgsql Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: IS NOT DISTINCT FROM + Indexing
Date: 2014-07-22 01:51:08
Message-ID: 17764.1405993868@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

"Jonathan S. Katz" <jonathan(dot)katz(at)excoventures(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Kapila 2014-07-22 03:17:19 Re: [BUGS] BUG #9652: inet types don't support min/max
Previous Message MauMau 2014-07-22 01:09:04 Re: [bug fix] Suppress "autovacuum: found orphan temp table" message