Re: refactor ExecInitPartitionInfo

From: Andreas Karlsson <andreas(at)proxel(dot)se>
To: jian he <jian(dot)universality(at)gmail(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: refactor ExecInitPartitionInfo
Date: 2026-02-23 02:28:57
Message-ID: de595a8e-2fc0-4931-94e5-3cb00d91d698@proxel.se
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2/21/26 4:07 PM, jian he wrote:
> V1 is way too complicated.
> IMHO, we can just do
>
> if (node != NULL)
> part_attmap = build_attrmap_by_name(RelationGetDescr(partrel),
> RelationGetDescr(firstResultRel),
> false);
>
> We have now consolidated five uses of build_attrmap_by_name into one.

Hm, why would that be ok? As far as I can tell the current code tries
hard to not build the attmap unless it is actually needed while you
propose to build it almost unconditionally. While the code is less
complicated with your patch it instead has to do more work in some
cases, right?

Andreas

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Hayato Kuroda (Fujitsu) 2026-02-23 04:41:30 RE: Patch for migration of the pg_commit_ts directory
Previous Message Andreas Karlsson 2026-02-23 02:17:52 Re: Use pg_malloc macros in src/fe_utils