Constraint exclusion and overlapping range checks - Mailing list pgsql-general

From Steve Atkins
Subject Constraint exclusion and overlapping range checks
Date
Msg-id 001F8F39-07B8-46C2-ADE1-985BE4C533DB@blighty.com
Whole thread Raw
Responses Re: Constraint exclusion and overlapping range checks  (François Beausoleil <francois@teksol.info>)
List pgsql-general
If I have a partitioned table that has some range constraints that look kinda like they're intended for constraint
exclusion,but aren't quite non-overlapping, will that break anything? 

e.g.

  create table jan ( …, check(created >= '2013-01-01' and created < '2013-02-01'), check(id >=0 and id < 10000100) )
inherits(foo);
  create table feb ( …, check(created >= '2013-02-01' and created < '2013-03-01'), check(id >=1000000 and id <
20000100)) inherits(foo); 
  create table mar ( …, check(created >= '2013-03-01' and created < '2013-04-01'), check(id >=2000000 and id <
30000100)) inherits(foo); 

Querying by created should be fine, and take advantage of constraint exclusion, but will querying by id work? And if it
doeswork, will it take any advantage of those constraints at all, or just search all the child partitions? 

Cheers,
  Steve




pgsql-general by date:

Previous
From: Jeff Janes
Date:
Subject: Re: select DISTINCT
Next
From: François Beausoleil
Date:
Subject: Re: Constraint exclusion and overlapping range checks