Re: [HACKERS] Constraint exclusion for partitioned tables

2017-09-13 Thread Ashutosh Bapat
On Wed, Sep 13, 2017 at 12:17 PM, Jeevan Chalke wrote: > > > On Tue, Sep 12, 2017 at 8:12 PM, Robert Haas wrote: >> >> On Tue, Sep 12, 2017 at 7:08 AM, Jeevan Chalke >> wrote: >> > This patch clearly improves

Re: [HACKERS] Constraint exclusion for partitioned tables

2017-09-13 Thread Jeevan Chalke
On Tue, Sep 12, 2017 at 8:12 PM, Robert Haas wrote: > On Tue, Sep 12, 2017 at 7:08 AM, Jeevan Chalke > wrote: > > This patch clearly improves the planning time with given conditions. > > > > To verify that, I have created a table like: > >

Re: [HACKERS] Constraint exclusion for partitioned tables

2017-09-12 Thread Robert Haas
On Tue, Sep 12, 2017 at 7:08 AM, Jeevan Chalke wrote: > This patch clearly improves the planning time with given conditions. > > To verify that, I have created a table like: > create table foo(a int, b int check (b > 100), c text) partition by > range(a); > And

Re: [HACKERS] Constraint exclusion for partitioned tables

2017-09-12 Thread Jeevan Chalke
Hi, I had a look at these changes and here are my observations: 1. Patch applies cleanly with "git apply'. 2. make / make install / make check-world all are good. This patch clearly improves the planning time with given conditions. To verify that, I have created a table like: create table

Re: [HACKERS] Constraint exclusion for partitioned tables

2017-07-31 Thread Robert Haas
On Thu, Apr 6, 2017 at 6:47 AM, Ashutosh Bapat wrote: > I am guessing that for normal inheritance, a constraint on parent > doesn't necessarily imply the same constraint on the child (Amit > Langote gives me an example of NOT NULL constraint). CHECK constraints

[HACKERS] Constraint exclusion for partitioned tables

2017-04-06 Thread Ashutosh Bapat
Hi, In relation_excluded_by_constraints(), we do not apply constraint exclusion if rte->inh is true. /* Only plain relations have constraints */ if (rte->rtekind != RTE_RELATION || rte->inh) return false; Thus every partitioned table will not benefit from the constraint