| От | Tom Lane |
|---|---|
| Тема | Re: Joins and their efficiencies |
| Дата | |
| Msg-id | 23233.1049318215@sss.pgh.pa.us обсуждение |
| Ответ на | Joins and their efficiencies (Hadley Willan <hadley.willan@deeperdesign.co.nz>) |
| Список | pgsql-general |
Hadley Willan <hadley.willan@deeperdesign.co.nz> writes:
> Is it correct then to assume that a LEFT JOIN is more efficient than a
> straight join?
Not at all. I would imagine that the left join forced the planner to
adopt a different plan than it used otherwise (perhaps a different join
order), and that this other plan was much faster than the original,
whereas the planner's estimate had it slower (else it would have used
that plan to begin with).
It could also be that the change in the WHERE clauses had something to
do with it.
If you want to investigate further, make sure your ANALYZE stats are up
to date, then post EXPLAIN ANALYZE results for both queries.
regards, tom lane
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера