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

Поиск
Список
Период
Сортировка
От Gavin Wahl
Тема Re: Planner Conceptual Error when Joining a Subquery -- Outer Query Condition not Pulled Into Subquery
Дата
Msg-id CACPudh0h1tvujVnas=4D-b+JsWy2d8CVO761v5558c+P-50LWg@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Planner Conceptual Error when Joining a Subquery -- Outer Query Condition not Pulled Into Subquery  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-performance
> (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.

I see, that makes sense. I assumed there was something more complex going on in
the background.  What about converting (1) into (2)? I know the planner does
something kind of similar, in converting

  SELECT * FROM (SELECT * FROM x WHERE a) WHERE b

into

  SELECT * FROM (SELECT * FROM x WHERE a AND b)

I guess in this case it would have to know about unique indexes to prove that
if the primary keys are equal, all the other columns are too. My intention in
trying (3) was to take that burden of proof off the planner.

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

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