Re: default range partition and constraint exclusion - Mailing list pgsql-hackers

From Robert Haas
Subject Re: default range partition and constraint exclusion
Date
Msg-id CA+Tgmoaxz2fjLGmXO790V7kO38D6Xm2BHkv-h0_tRUGvxOf1pg@mail.gmail.com
Whole thread Raw
In response to default range partition and constraint exclusion  (Amit Langote <Langote_Amit_f8@lab.ntt.co.jp>)
Responses Re: default range partition and constraint exclusion  (Amit Langote <Langote_Amit_f8@lab.ntt.co.jp>)
List pgsql-hackers
On Fri, Nov 17, 2017 at 12:57 AM, Amit Langote
<Langote_Amit_f8@lab.ntt.co.jp> wrote:
> While working on the patch for partition pruning for declarative
> partitioned tables, I noticed that default range partition will fail to be
> included in a plan in certain cases due to pruning by constraint exclusion.
> you'll notice that it doesn't explicitly say that the default partition
> allows rows where a is null or b is null or both are null.  Given that,
> constraint exclusion will end up concluding that the default partition's
> constraint is refuted by a = 2.
>
> The attached will make the constraint to look like:

Uh, if the constraint exclusion logic we're using is drawing false
conclusions, we need to fix it so it doesn't, not change the
constraint so that the wrong logic gives the right answer.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: [HACKERS] pg_upgrade to clusters with a different WAL segment size
Next
From: Peter Geoghegan
Date:
Subject: Re: Treating work_mem as a shared resource (Was: Parallel Hash take II)