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)
Список
Дерево обсуждения
Left Outer Join much faster than non-outer Join? rm_pg@cheapcomplexdevices.com
Re: Left Outer Join much faster than non-outer Join? Tom Lane <tgl@sss.pgh.pa.us>
Re: Left Outer Join much faster than non-outer Join? Ron Mayer <rm_pg@cheapcomplexdevices.com>
Re: Left Outer Join much faster than non-outer Join? Ron Mayer <rm_pg@cheapcomplexdevices.com>
Re: Left Outer Join much faster than non-outer Join? Simon Riggs <simon@2ndquadrant.com>
Re: Left Outer Join much faster than non-outer Join? Ron Mayer <rm_pg@cheapcomplexdevices.com>
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 по дате отправления