Re: huge runtime difference between 2 almost identical queries (was: Re: Index Scans become Seq Scans after VACUUM ANALYSE)

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: huge runtime difference between 2 almost identical queries (was: Re: Index Scans become Seq Scans after VACUUM ANALYSE)
Дата
Msg-id 7056.1019060087@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: huge runtime difference between 2 almost identical queries (was: Re: Index Scans become Seq Scans after VACUUM ANALYSE)  (Louis-David Mitterrand <vindex@apartia.org>)
Список pgsql-hackers
Louis-David Mitterrand <vindex@apartia.org> writes:
> Hmm, since 7.1 released we have religiously converted all our joins to
> the new syntax, thinking it more politically correct ;-). But now all
> our beliefs are put into question. Back to old joins, in certain cases.

> Here is the rule of thumb we deduct from your message: only use explicit
> join syntax if a left|right|full join is involved OR if the
> conditional(s) can go into the ON() clause, ELSE use the old join
> syntax.

I don't see that the ON clause has anything to do with it.  You must use
the JOIN syntax for any kind of outer join, of course.  For an inner
join, the planner currently has a better shot at choosing the right plan
if you don't use JOIN syntax.

See nearby thread for some discussion about tweaking this aspect of the
planner's behavior.
        regards, tom lane


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Index Scans become Seq Scans after VACUUM ANALYSE
Следующее
От: Hannu Krosing
Дата:
Сообщение: Re: Index Scans become Seq Scans after VACUUM ANALYSE