contraints_exclusion fails to refute simple condition

Поиск
Список
Период
Сортировка
От Sandro Santilli
Тема contraints_exclusion fails to refute simple condition
Дата
Msg-id 20150305122020.GA30797@localhost
обсуждение исходный текст
Ответы Re: contraints_exclusion fails to refute simple condition  (Andrew Gierth <andrew@tao11.riddles.org.uk>)
Список 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 по дате отправления:

Предыдущее
От: "Syed, Rahila"
Дата:
Сообщение: Re: [REVIEW] Re: Compression of full-page-writes
Следующее
От: Pavel Stehule
Дата:
Сообщение: Re: Providing catalog view to pg_hba.conf file - Patch submission