Re: Partitioning on IS NULL / IS NOT NULL not supported? - Mailing list pgsql-general

From Tom Lane
Subject Re: Partitioning on IS NULL / IS NOT NULL not supported?
Date
Msg-id 23535.1178993866@sss.pgh.pa.us
Whole thread Raw
In response to Partitioning on IS NULL / IS NOT NULL not supported?  (Aleksander Kmetec <aleksander.kmetec@intera.si>)
List pgsql-general
Aleksander Kmetec <aleksander.kmetec@intera.si> writes:
> I'm trying to split a table into 2 partitions based on whether a field's value is NULL or NOT NULL, but when I run
> "EXPLAIN SELECT * FROM tab WHERE version IS NULL" it shows that both partitions are being scanned, not just the one
> which contains rows where version is null.

> Is this not supported?

Nope, predicate_refuted_by() doesn't cover that particular combination
at the moment.  The case it does cover was motivated by the thought of
having a regular partitioning into different value classes plus a
partition for NULLs, hence it knows that a test like "version = X"
refutes "version IS NULL".

            regards, tom lane

pgsql-general by date:

Previous
From: "L. Berger"
Date:
Subject: TWO SAME TABLES, ONE UPDATED. HOW TO SYNC THE OTHER?
Next
From: Tom Lane
Date:
Subject: Re: Missing magic block