Re: IS NOT DISTINCT FROM + Indexing

From: Kevin Grittner <kgrittn(at)ymail(dot)com>
To: "Jonathan S(dot) Katz" <jonathan(dot)katz(at)excoventures(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Pgsql Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: IS NOT DISTINCT FROM + Indexing
Date: 2014-07-23 17:33:50
Message-ID: 1406136830.49529.YahooMailNeo@web122302.mail.ne1.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Jonathan S. Katz <jonathan(dot)katz(at)excoventures(dot)com> wrote:

> before embarking on something laborious (as even just indexing
> is nontrivial), I think it would be good to figure out how people
> are using IS [NOT] DISTINCT FROM and if there is interest in
> having it be indexable, let alone used in a JOIN optimization.
> It could become a handy tool to simplify the SQL in queries that
> are returning a lot of NULL / NOT NULL data mixed together.

To prevent subtle inconsistencies, I think we would need to limit
support to data types with a btree opclass which uses "=" as the
equality operator on indexes using that opclass (either by default
or explicitly).  That limitation would still allow a lot of useful
cases.

--
Kevin Grittner
EDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2014-07-23 17:37:23 Re: PDF builds broken again
Previous Message Alvaro Herrera 2014-07-23 17:32:31 Re: postgresql.auto.conf and reload