Re: Left Outer Join much faster than non-outer Join?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Left Outer Join much faster than non-outer Join?
Дата
Msg-id 1755.1112242072@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Left Outer Join much faster than non-outer Join?  (rm_pg@cheapcomplexdevices.com)
Ответы Re: Left Outer Join much faster than non-outer Join?
Список pgsql-performance
rm_pg@cheapcomplexdevices.com writes:
>  select *
>      from streetname_lookup as sl
>      join city_lookup as cl on (true)
>      left outer join tlid_smaller as ts on (sl.geo_streetname_id = ts.geo_streetname_id and
cl.geo_city_id=ts.geo_city_id)
>      where  str_name='alamo' and  city='san antonio' and state='TX'
> ;

That's a fairly odd query; why don't you have any join condition between
streetname_lookup and city_lookup?

The planner won't consider Cartesian joins unless forced to, which is
why it fails to consider the join order "((sl join cl) join ts)" unless
you have an outer join in the mix.  I think that's generally a good
heuristic, and am disinclined to remove it ...

            regards, tom lane

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

Предыдущее
От: John Arbash Meinel
Дата:
Сообщение: Re: fine tuning for logging server
Следующее
От: Ron Mayer
Дата:
Сообщение: Re: Left Outer Join much faster than non-outer Join?