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+TgmoaN29OuNjEVJ8JO=eVyXTekwcS0+OnyyKdJsxcH_Tyrxg@mail.gmail.com
Whole thread Raw
In response to Re: 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 Tue, Nov 21, 2017 at 4:36 AM, Amit Langote
<Langote_Amit_f8@lab.ntt.co.jp> wrote:
>>> 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.
>
> I did actually consider it, but ended up concluding that constraint
> exclusion is doing all it can using the provided list partition constraint
> clauses.
>
> If all predicate_refuted_by() receives is the expression tree (AND/OR)
> with individual nodes being strict clauses involving partition keys (and
> nothing about the nullness of the keys), the downstream code is just
> playing by the rules as explained in the header comment of
> predicate_refuted_by_recurse() in concluding that query's restriction
> clause a = 2 refutes it.

Oh, wait a minute.  Actually, I think predicate_refuted_by() is doing
the right thing here.  Isn't the problem that mc2p2 shouldn't be
accepting a (2, null) tuple at all?

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


pgsql-hackers by date:

Previous
From: Simon Riggs
Date:
Subject: Re: Logical Replication and triggers
Next
From: Robert Haas
Date:
Subject: Re: Logical Replication and triggers