Re: Planner Conceptual Error when Joining a Subquery -- Outer Query Condition not Pulled Into Subquery

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Planner Conceptual Error when Joining a Subquery -- Outer Query Condition not Pulled Into Subquery
Дата
Msg-id 7176.1381912124@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Planner Conceptual Error when Joining a Subquery -- Outer Query Condition not Pulled Into Subquery  (Gavin Wahl <gavinwahl@gmail.com>)
Ответы Re: Planner Conceptual Error when Joining a Subquery -- Outer Query Condition not Pulled Into Subquery
Список pgsql-performance
Gavin Wahl <gavinwahl@gmail.com> writes:
> It'd be nice if the planner could optimize the query (1) by turning it
> into (2). I understand that it might not be able to, but if it can pull
> the condition up in (3), why can't it in (4)?

(3) is an instance of seeing "a = b and b = c" and deducing "a = c" from
that.  (4) does not follow that pattern, so it's outside the realm of
what the planner can deduce.

In principle we could take "a = b and (b = c or b = d)" and deduce
"a = c or a = d" from that, but it'd be a lot more complication for a
lot less benefit than what we get from the existing logic.

            regards, tom lane


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

Предыдущее
От: Ken Tanzer
Дата:
Сообщение: Re: BASH script for collecting analyze-related info
Следующее
От: Gavin Wahl
Дата:
Сообщение: Re: Planner Conceptual Error when Joining a Subquery -- Outer Query Condition not Pulled Into Subquery