Re: Enabling constraint_exclusion does not avoid scanning all child partitions

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Enabling constraint_exclusion does not avoid scanning all child partitions
Дата
Msg-id 24770.1165184727@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Enabling constraint_exclusion does not avoid scanning all child partitions  ("Fayza Sultan" <fayza.sultan@gmail.com>)
Ответы Re: Enabling constraint_exclusion does not avoid scanning all child partitions  ("Fayza Sultan" <fayza.sultan@gmail.com>)
Список pgsql-performance
"Fayza Sultan" <fayza.sultan@gmail.com> writes:
> CREATE TABLE parent (
>     monthdate date NOT NULL,
>     id int4 NOT NULL,
>     CONSTRAINT parent_idx PRIMARY KEY (monthdate,id )
> );

> CREATE TABLE child1
> (
> CONSTRAINT child1_idx PRIMARY KEY (monthdate,id),
> CONSTRAINT child1_chk CHECK (monthdate >= '2006-01-01 00:00:00'::timestamp
> without time zone AND monthdate < '2006-02-01 00:00:00'::timestamp without
> time zone)

monthdate is date, not timestamp.  See the caveat in the documentation
about avoiding cross-type comparisons when formulating constraints for
constraint exclusion to use.

            regards, tom lane

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

Предыдущее
От: "Fayza Sultan"
Дата:
Сообщение: Enabling constraint_exclusion does not avoid scanning all child partitions
Следующее
От: "Fayza Sultan"
Дата:
Сообщение: Re: Enabling constraint_exclusion does not avoid scanning all child partitions