Re: Constraint exclusion

Поиск
Список
Период
Сортировка
От Fernando Hevia
Тема Re: Constraint exclusion
Дата
Msg-id 041a01c7b44f$a0a459d0$8f01010a@iptel.com.ar
обсуждение исходный текст
Ответ на Re: Constraint exclusion  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-sql
I see. Thanks for the tip.

Regards,
Fernando.

-----Mensaje original-----
De: Tom Lane [mailto:tgl@sss.pgh.pa.us]
Enviado el: Miércoles, 20 de Junio de 2007 19:37
Para: Fernando Hevia
CC: 'PostgreSQL SQL List'
Asunto: Re: [SQL] Constraint exclusion

"Fernando Hevia" <fhevia@ip-tel.com.ar> writes:
> -- Constraints: one partition per month
> ALTER TABLE table_p01 ADD CONSTRAINT chk_table_p01_setuptime CHECK
> (EXTRACT(MONTH FROM setuptime) =  1::DOUBLE PRECISION);

The planner is not able to do anything with these constraints, other
than if there is an exact match to them in the query WHERE, which
there is not.  Try simple range constraints on the column, instead.
The system does know about inferences like "colx <= const1 must
imply colx <= const2 if const1 <= const2".  It does not know how
to reason about extract().
        regards, tom lane



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

Предыдущее
От: Ragnar
Дата:
Сообщение: Re: join problem
Следующее
От: "Bart Degryse"
Дата:
Сообщение: Transactions and Exceptions