| От | Sandro Santilli |
|---|---|
| Тема | contraints_exclusion fails to refute simple condition |
| Дата | |
| Msg-id | 20150305122020.GA30797@localhost обсуждение исходный текст |
| Ответы |
Re: contraints_exclusion fails to refute simple condition
|
| Список | pgsql-hackers |
PostGIS installs standard constraints of this kind: CHECK (geometrytype(g) = 'POINT'::text OR g IS NULL) The constraint is used by constraint_exclusion if using this condition: WHERE g IS NOT NULL AND geometrytype(g) = 'LINESTRING' But it is _NOT_ used if the NOT NULL condition is removed: WHERE geometrytype(g) = 'LINESTRING' As the "geometrytype" is defined as STRICT and IMMUTABLE, there's no way for geometrytype(g) = 'LINESTRING' to hold true, so why is the "IS NOT NULL" condition also needed by the planner ? Andres Freund on IRC suggested that predicate_refuted_by_simple_clause() looks like trying to handle such cases, but if that's the case it seems to fail here. --strk;
В списке pgsql-hackers по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера