Re: FOR PORTION OF does not recompute GENERATED STORED columns that depend on the range column

From: Paul A Jungwirth <pj(at)illuminatedcomputing(dot)com>
To: jian he <jian(dot)universality(at)gmail(dot)com>
Cc: Chao Li <li(dot)evan(dot)chao(at)gmail(dot)com>, Peter Eisentraut <peter(at)eisentraut(dot)org>, SATYANARAYANA NARLAPURAM <satyanarlapuram(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: FOR PORTION OF does not recompute GENERATED STORED columns that depend on the range column
Date: 2026-05-12 19:26:01
Message-ID: CA+renyX4UaO7T=sC2UcpKUwS2yd7zt3XxOm1MgXv5W82ucbk0w@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, May 11, 2026 at 5:03 AM jian he <jian(dot)universality(at)gmail(dot)com> 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 ~{:-)
pj(at)illuminatedcomputing(dot)com

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2026-05-12 19:27:17 Re: Review - Patch for pg_bsd_indent: improve formatting of multiline comments
Previous Message Bruce Momjian 2026-05-12 19:11:16 Re: First draft of PG 19 release notes