Re: why memoize is not used for correlated subquery

Поиск
Список
Период
Сортировка
От Tender Wang
Тема Re: why memoize is not used for correlated subquery
Дата
Msg-id CAHewXN=WJBWr6LR6S48sMQY5j9ArKGZNL6FoL2QOchnW9LLj7A@mail.gmail.com
обсуждение исходный текст
Ответ на why memoize is not used for correlated subquery  (Pavel Stehule <pavel.stehule@gmail.com>)
Список pgsql-hackers


Pavel Stehule <pavel.stehule@gmail.com> 于2024年5月28日周二 15:31写道:
Hi


My question is - does memoize support subqueries? And can be enhanced to support this exercise without LATERAL and optimization fences?


The commit messages in memoize may answer your question:

   "For now, the planner will only consider using a result cache for
    parameterized nested loop joins.  This works for both normal joins and
    also for LATERAL type joins to subqueries.  It is possible to use this new
    node for other uses in the future.  For example, to cache results from
    correlated subqueries.  However, that's not done here due to some
    difficulties obtaining a distinct estimation on the outer plan to
    calculate the estimated cache hit ratio.  Currently we plan the inner plan
    before planning the outer plan so there is no good way to know if a result
    cache would be useful or not since we can't estimate the number of times
    the subplan will be called until the outer plan is generated." 

git show b6002a796d
--
Tender Wang
OpenPie:  https://en.openpie.com/

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

Предыдущее
От: Pavel Stehule
Дата:
Сообщение: why memoize is not used for correlated subquery
Следующее
От: David Rowley
Дата:
Сообщение: Re: why memoize is not used for correlated subquery