Re: Constraint exclusion

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Constraint exclusion
Дата
Msg-id 3618.1182379001@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Constraint exclusion  ("Fernando Hevia" <fhevia@ip-tel.com.ar>)
Ответы Re: Constraint exclusion  ("Fernando Hevia" <fhevia@ip-tel.com.ar>)
Список pgsql-sql
"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 по дате отправления:

Предыдущее
От: "Fernando Hevia"
Дата:
Сообщение: Constraint exclusion
Следующее
От: Bryce Nesbitt
Дата:
Сообщение: Technique for turning time ranges into a graph