LEFT JOIN LATERAL optimisation at plan time

Поиск
Список
Период
Сортировка
От Nicolas Paris
Тема LEFT JOIN LATERAL optimisation at plan time
Дата
Msg-id 20180918070636.tp243ftlwpzrfrsd@riseup.net
обсуждение исходный текст
Ответы Re: LEFT JOIN LATERAL optimisation at plan time
Список pgsql-performance
Hi,

For a traditional LEFT JOIN, in case the SELECT does not mention a field
from a joined table being unique , the planner removes the join. Eg:

SELECT a, b --,c
FROM table1
LEFT JOIN (select a, c from table2 group by a) joined USING (a)

However this behavior is not the same for LATERAL JOINS

SELECT a, b --,c
FROM table1
LEFT JOIN LATERAL (select a, c from table2 where table1.a = table2.a group by a) joined ON TRUE

In this case, the planner still consider the joined table. My guess is
it could remove it .


Any thought ?

-- 
nicolas


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