Re: Check lateral references within PHVs for memoize cache keys

Поиск
Список
Период
Сортировка
От Andrei Lepikhov
Тема Re: Check lateral references within PHVs for memoize cache keys
Дата
Msg-id 2a76386f-a104-461b-8d15-ff6c4d762925@gmail.com
обсуждение исходный текст
Ответ на Re: Check lateral references within PHVs for memoize cache keys  (Richard Guo <guofenglinux@gmail.com>)
Ответы Re: Check lateral references within PHVs for memoize cache keys
Список pgsql-hackers
On 7/11/24 16:18, Richard Guo wrote:
> On Fri, Jun 28, 2024 at 10:14 PM Andrei Lepikhov <lepihov@gmail.com> wrote:
>> I got the point about Memoize over join, but as a join still calls
>> replace_nestloop_params to replace parameters in its clauses, why not to
>> invent something similar to find Memoize keys inside specific JoinPath
>> node? It is not the issue of this patch, though - but is it doable?
> 
> I don't think it's impossible to do, but I'm skeptical that there's an
> easy way to identify all the cache keys for joinrels, without having
> available ppi_clauses and lateral_vars.
Ok

> 
>> IMO, the code:
>> if (bms_nonempty_difference(outerPlan->chgParam, node->keyparamids))
>>     cache_purge_all(node);
>>
>> is a good place to check an assertion: is it really the parent query
>> parameters that make a difference between memoize keys and node list of
>> parameters?
> 
> I don't think we have enough info available here to identify which
> params within outerPlan->chgParam are from outer levels.  Maybe we can
> store root->outer_params in the MemoizeState node to help with this
> assertion, but I'm not sure if it's worth the trouble.
Got it
> 
> Attached is an updated version of this patch.
I'm not sure about stability of output format of AVG aggregate across 
different platforms. Maybe better to return the result of comparison 
between the AVG() and expected value?

-- 
regards, Andrei Lepikhov




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

Предыдущее
От: Andrei Lepikhov
Дата:
Сообщение: Re: Removing unneeded self joins
Следующее
От: Tatsuo Ishii
Дата:
Сообщение: Re: Optimize WindowAgg's use of tuplestores