Evaluate arguments of correlated SubPlans in the referencing ExprState

Поиск
Список
Период
Сортировка
От Andres Freund
Тема Evaluate arguments of correlated SubPlans in the referencing ExprState
Дата
Msg-id 20230225214401.346ancgjqc3zmvek@awork3.anarazel.de
обсуждение исходный текст
Ответы Re: Evaluate arguments of correlated SubPlans in the referencing ExprState  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
Hi,

Around
https://www.postgresql.org/message-id/20230224015417.75yimxbksejpffh3%40awork3.anarazel.de
I suggested that we should evaluate the arguments of correlated SubPlans as
part of the expression referencing the subplan.

Here's a patch for that.

Ended up simpler than I'd thought. I see small, consistent, speedups and
reductions in memory usage.

I think individual arguments are mainly (always?)  Var nodes. By evaluating
them as part of the containing expression we avoid the increased memory usage,
and the increased dispatch of going through another layer of
ExprState. Because the arguments are a single Var, which end up with a
slot_getattr() via ExecJust*Var, we also elide redundant slot_getattr()
checks. I think we already avoided redundant tuple deforming, because the
parent ExprState will have done that already.

Greetings,

Andres Freund

Вложения

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

Предыдущее
От: Magnus Hagander
Дата:
Сообщение: Re: use __builtin_clz to compute most significant bit set
Следующее
От: Nathan Bossart
Дата:
Сообщение: Re: stopgap fix for signal handling during restore_command