Re: Constraint exclusion and overlapping range checks

Поиск
Список
Период
Сортировка
От François Beausoleil
Тема Re: Constraint exclusion and overlapping range checks
Дата
Msg-id 8A19E5D8-0CC9-4A22-BA5C-B0C7DA0F3D6D@teksol.info
обсуждение исходный текст
Ответ на Constraint exclusion and overlapping range checks  (Steve Atkins <steve@blighty.com>)
Ответы Re: Constraint exclusion and overlapping range checks  (Steve Atkins <steve@blighty.com>)
Список pgsql-general
Le 2013-09-07 à 00:29, Steve Atkins a écrit :

> 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
itdoes work, will it take any advantage of those constraints at all, or just search all the child partitions? 

I don't know, but I suspect a quick EXPLAIN ANALYZE will tell you, even with empty tables.

Bye,
François
Вложения

В списке pgsql-general по дате отправления:

Предыдущее
От: Steve Atkins
Дата:
Сообщение: Constraint exclusion and overlapping range checks
Следующее
От: Steve Atkins
Дата:
Сообщение: Re: Constraint exclusion and overlapping range checks