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  (Tom Lane <tgl@sss.pgh.pa.us>)
Список 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 по дате отправления:

Предыдущее
От: Laurenz Albe
Дата:
Сообщение: Re: Select count(*) on a 2B Rows Tables Takes ~20 Hours
Следующее
От: Andrey Zhidenkov
Дата:
Сообщение: Performance problems with Thai language