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

From Alvaro Herrera
Subject Re: IS NOT DISTINCT FROM + Indexing
Date
Msg-id 20140723173036.GA5475@eldon.alvh.no-ip.org
Whole thread Raw
In response to Re: IS NOT DISTINCT FROM + Indexing  ("Jonathan S. Katz" <jonathan.katz@excoventures.com>)
List pgsql-hackers
Jonathan S. Katz wrote:

> Well that definitely answers "how hard would it be." - 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.

FWIW my project (abandoned for now, but I intend to get back to it
someday) to catalog NOT NULL constraints in pg_constraint had me
rewriting them into some kind of IS DISTINCT FROM NULL expression.  (It
was IS NOT NULL initially until somebody pointed out that that wouldn't
work for composite type columns).  I'm not sure how that interacts with
what you're doing here, maybe not at all; I thought I'd mention it.

-- 
Álvaro Herrera                http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services



pgsql-hackers by date:

Previous
From: Emre Hasegeli
Date:
Subject: Re: Index-only scans for multicolumn GIST
Next
From: Alvaro Herrera
Date:
Subject: Re: postgresql.auto.conf and reload