pgsql: Make real sure we don't reassociate joins into or out of SEMI/AN

Поиск
Список
Период
Сортировка
От Tom Lane
Тема pgsql: Make real sure we don't reassociate joins into or out of SEMI/AN
Дата
Msg-id E1ZN3bN-00087o-D0@gemulon.postgresql.org
обсуждение исходный текст
Список pgsql-committers
Make real sure we don't reassociate joins into or out of SEMI/ANTI joins.

Per the discussion in optimizer/README, it's unsafe to reassociate anything
into or out of the RHS of a SEMI or ANTI join.  An example from Piotr
Stefaniak showed that join_is_legal() wasn't sufficiently enforcing this
rule, so lock it down a little harder.

I couldn't find a reasonably simple example of the optimizer trying to
do this, so no new regression test.  (Piotr's example involved the random
search in GEQO accidentally trying an invalid case and triggering a sanity
check way downstream in clause selectivity estimation, which did not seem
like a sequence of events that would be useful to memorialize in a
regression test as-is.)

Back-patch to all active branches.

Branch
------
REL9_0_STABLE

Details
-------
http://git.postgresql.org/pg/commitdiff/c084f613e20165012974db44106e4c5174c2ba5f

Modified Files
--------------
src/backend/optimizer/path/joinrels.c |   15 +++++++++------
1 file changed, 9 insertions(+), 6 deletions(-)


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: pgsql: Make real sure we don't reassociate joins into or out of SEMI/AN
Следующее
От: Tom Lane
Дата:
Сообщение: pgsql: Make real sure we don't reassociate joins into or out of SEMI/AN