Re: moving extraUpdatedCols out of RangeTblEntry (into ModifyTable)

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Amit Langote <amitlangote09(at)gmail(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
Subject: Re: moving extraUpdatedCols out of RangeTblEntry (into ModifyTable)
Date: 2023-01-04 00:15:29
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

I wrote:
> I think what we have to do basically is repeat what fill_extraUpdatedCols
> does independently for each target table. That's not really horrible:
> given the premise that we're moving this calculation into the planner,
> we can have expand_single_inheritance_child run the code while we have
> each target table open. It'll require some rethinking though, and we
> will need to have the set of update target columns already available
> at that point. This suggests that we want to put the updated_cols and
> extraUpdatedCols fields into RelOptInfo not PlannerInfo.

After further thought: maybe we should get radical and postpone this
work all the way to executor startup. The downside of that is having
to do it over again on each execution of a prepared plan. But the
upside is that when the UPDATE targets a many-partitioned table,
we would have a chance at not doing the work at all for partitions
that get pruned at runtime. I'm not sure if that win would emerge
immediately or if we still have executor work to do to manage pruning
of the target table. I'm also not sure that this'd be a net win
overall. But it seems worth considering.

regards, tom lane

In response to


Browse pgsql-hackers by date

  From Date Subject
Next Message Nathan Bossart 2023-01-04 00:37:00 Re: Common function for percent placeholder replacement
Previous Message Nathan Bossart 2023-01-03 23:45:49 Re: allow granting CLUSTER, REFRESH MATERIALIZED VIEW, and REINDEX