Re: [GENERAL] Partitioning and constraint exclusion

2015-09-08 Thread Jayadevan M
> > > > ​I am not sure but am doubting it is intelligent enough to recognize the > functional expression even if all of the values are present. "simple > equality" ( > http://www.postgresql.org/docs/9.4/interactive/ddl-partitioning.html) > this is not. > Looks like the tables with about 100+ valu

Re: [GENERAL] Partitioning and constraint exclusion

2015-09-07 Thread Jayadevan M
On Mon, Sep 7, 2015 at 7:12 PM, Melvin Davidson wrote: > First, what is the PostgresSQL version ?? > 9.3.6 > > Next, in postgresql.conf, what is the value of constraint_exclusion ? > partition In response to the other possible issues pointed out - the planner is indeed *skipping the rest

Re: [GENERAL] Partitioning and constraint exclusion

2015-09-07 Thread Vick Khera
On Mon, Sep 7, 2015 at 4:48 PM, David G. Johnston < david.g.johns...@gmail.com> wrote: > IIRC ​The planner doesn't understand​ > > ​overlaps so having a definition of: > > IN (1,2,3,4,5); or nearly equivalently = ANY(ARRAY[1,2,3,4,5]))​ > > and a request for: > > IN (1,3,5) / = ANY(ARRAY[1,3,5]) i

Re: [GENERAL] Partitioning and constraint exclusion

2015-09-07 Thread David G. Johnston
On Mon, Sep 7, 2015 at 8:55 AM, Jayadevan M wrote: > Hello , > > I have a parent table and 6 child tables (partitions). The child tables > have check constraints defined in the form > CHECK (myuid in (123,456,..)). > myuid is bigint, the constraints for the 6 child tables are definitely > mutuall

Re: [GENERAL] Partitioning and constraint exclusion

2015-09-07 Thread Melvin Davidson
First, what is the PostgresSQL version ?? Next, in postgresql.conf, what is the value of constraint_exclusion ? On Mon, Sep 7, 2015 at 8:55 AM, Jayadevan M wrote: > Hello , > > I have a parent table and 6 child tables (partitions). The child tables > have check constraints defined in the fo

Re: [GENERAL] Partitioning and constraint exclusion

2015-03-05 Thread Stephen Frost
Sam, * Samuel Smith (pg...@net153.net) wrote: > Does anyone know if there is a wishlist item for improving this in > postgresql or is this as good as it gets for now? It's absolutely on the todo list for PG to support declarative partitioning and handle these cases better. There has been a good

Re: [GENERAL] Partitioning and constraint exclusion

2015-03-05 Thread Samuel Smith
On 03/04/2015 12:11 AM, David G Johnston wrote: In short - since the planner determines exclusion constraints and the executor, which strictly follows the planner in the query execution process, would be the one to determine what the value of your date is - there is no way for a single query to

Re: [GENERAL] Partitioning and constraint exclusion

2015-03-04 Thread Stephen Frost
Samuel, * Samuel Smith (pg...@net153.net) wrote: > I noticed that I could get very nice partition elimination using > constant values in the where clause. > > Ex: > select * from where between '2015-01-01' > and '2015-02-15' > > However, I could not get any partition elimination for queries th

Re: [GENERAL] Partitioning and constraint exclusion

2015-03-03 Thread David G Johnston
Samuel Smith wrote > I noticed that I could get very nice partition elimination using > constant values in the where clause. > > Ex: > select * from > where > > between '2015-01-01' and > '2015-02-15' > > However, I could not get any partition elimination for queries that did > not have

Re: [GENERAL] Partitioning and constraint exclusion

2011-06-21 Thread Sylvain Rabot
On Tue, 2011-06-21 at 12:25 -0400, Tom Lane wrote: > Sylvain Rabot writes: > > On Postgres 9.1beta2 when i run this code the first select will use > > contraint exclusion but the second will not. > > This apparently has something to do with the size of the array > > returned by the fake immutable

Re: [GENERAL] Partitioning and constraint exclusion

2011-06-21 Thread Tom Lane
Sylvain Rabot writes: > On Postgres 9.1beta2 when i run this code the first select will use > contraint exclusion but the second will not. > This apparently has something to do with the size of the array > returned by the fake immutable function. See predtest.c: /* * Proof attempts involving la