Re: Planner reluctant to start from subquery

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Planner reluctant to start from subquery
Дата
Msg-id 4218.1138824885@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Planner reluctant to start from subquery  ("Kevin Grittner" <Kevin.Grittner@wicourts.gov>)
Ответы Re: Planner reluctant to start from subquery  ("Kevin Grittner" <Kevin.Grittner@wicourts.gov>)
Список pgsql-performance
"Kevin Grittner" <Kevin.Grittner@wicourts.gov> writes:
> Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> ... expected an equivalent IN clause to work better.  In fact, I'm not
>> clear why the planner isn't finding the cheapest plan (which it does
>> estimate as cheapest) from the IN version you posted.

> All I know is that trying various permutations, I saw it pick a good
> plan for the IN format when I eliminated the last outer join in the FROM
> clause.  I know it isn't conclusive, but it was a correlation which
> suggested a possible causality to me.

But there is still an outer join in your third example (the one with the
best plan), so that doesn't seem to hold water.  In any case, the way
that IN planning works these days it really should have considered the
plan equivalent to your JOIN-against-GROUP-BY variant.

I'm interested to poke at this ... are you in a position to provide a
test case?

            regards, tom lane

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

Предыдущее
От: "Kevin Grittner"
Дата:
Сообщение: Re: Planner reluctant to start from subquery
Следующее
От: Ralph Mason
Дата:
Сообщение: Index Usage using IN