pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Heikki Linnakangas <heikki.linnakangas@iki.fi>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Revise child-to-root tuple conversion map management.
Date: Mon, 19 Oct 2020 11:43:59 +0000
Message-ID: <E1kUTa3-0000Op-9I@gemulon.postgresql.org> (raw)

Revise child-to-root tuple conversion map management.

Store the tuple conversion map to convert a tuple from a child table's
format to the root format in a new ri_ChildToRootMap field in
ResultRelInfo. It is initialized if transition tuple capture for FOR
STATEMENT triggers or INSERT tuple routing on a partitioned table is
needed. Previously, ModifyTable kept the maps in the per-subplan
ModifyTableState->mt_per_subplan_tupconv_maps array, or when tuple
routing was used, in
ResultRelInfo->ri_Partitioninfo->pi_PartitionToRootMap. The new field
replaces both of those.

Now that the child-to-root tuple conversion map is always available in
ResultRelInfo (when needed), remove the TransitionCaptureState.tcs_map
field. The callers of Exec*Trigger() functions no longer need to set or
save it, which is much less confusing and bug-prone. Also, as a future
optimization, this will allow us to delay creating the map for a given
result relation until the relation is actually processed during
execution.

Author: Amit Langote
Discussion: https://www.postgresql.org/message-id/CA%2BHiwqHtCWLdK-LO%3DNEsvOdHx%2B7yv4mE_zYK0i3BH7dXb-wxog%40ma...

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/6973533650c04653d9018f61c1ac99ecb11094bd

Modified Files
--------------
src/backend/commands/copy.c            |  29 +----
src/backend/commands/trigger.c         |  10 +-
src/backend/executor/execMain.c        |   1 +
src/backend/executor/execPartition.c   |  23 ++--
src/backend/executor/nodeModifyTable.c | 210 +++++++++------------------------
src/include/commands/trigger.h         |  10 +-
src/include/executor/execPartition.h   |   6 -
src/include/nodes/execnodes.h          |  10 +-
8 files changed, 84 insertions(+), 215 deletions(-)



Message-ID: <E1kUTa3-0000Op-9I@gemulon.postgresql.org>
Permalink:  ../E1kUTa3-0000Op-9I@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1kUTa3-0000Op-9I@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: heikki.linnakangas@iki.fi
  Subject: Re: pgsql: Revise child-to-root tuple conversion map management.
  In-Reply-To: <E1kUTa3-0000Op-9I@gemulon.postgresql.org>
  References: <E1kUTa3-0000Op-9I@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox