On Mon, May 11, 2026 at 5:03 AM jian he <[email protected]> wrote:
>
> > > 2. I doubt if we need to switch to estate->es_query_cxt. Because
> > > ExecGetUpdatedCols() is called by ExecGetAllUpdatedCols(), and its header
> > > comment says the function runs in per-tuple memory context:
> > > ```
>
> Switching to estate->es_query_cxt can actually save some cycles.
>
> See ExecGetExtraUpdatedCols->ExecInitGenerated
> /*
> * Make sure these data structures are built in the per-query memory
> * context so they'll survive throughout the query.
> */
> oldContext = MemoryContextSwitchTo(estate->es_query_cxt);
I agree that seems nice, but it doesn't seem correct if we sometimes
change the context and sometimes not (from execute_attr_map_cols).
Yours,
--
Paul ~{:-)
[email protected]