Re: default range partition and constraint exclusion
Robert Haas <robertmhaas@gmail.com>
From: Robert Haas <robertmhaas@gmail.com>
To: Amit Langote <Langote_Amit_f8@lab.ntt.co.jp>
Cc: Pg Hackers <pgsql-hackers@postgresql.org>
Date: 2017-11-21T21:31:45Z
Lists: 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
Commits
-
Add null test to partition constraint for default range partitions.
- 7b88d63a9122 11.0 landed