From: Andres Freund <andres@anarazel.de>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Use slots more widely in tuple mapping code and make naming more
Date: Tue, 02 Oct 2018 18:38:54 +0000
Message-ID: <E1g7PZO-0003rj-IZ@gemulon.postgresql.org> (raw)
Use slots more widely in tuple mapping code and make naming more consistent.
It's inefficient to use a single slot for mapping between tuple
descriptors for multiple tuples, as previously done when using
ConvertPartitionTupleSlot(), as that means the slot's tuple descriptors
change for every tuple.
Previously we also, via ConvertPartitionTupleSlot(), built new tuples
after the mapping even in cases where we, immediately afterwards,
access individual columns again.
Refactor the code so one slot, on demand, is used for each
partition. That avoids having to change the descriptor (and allows to
use the more efficient "fixed" tuple slots). Then use slot->slot
mapping, to avoid unnecessarily forming a tuple.
As the naming between the tuple and slot mapping functions wasn't
consistent, rename them to execute_attr_map_{tuple,slot}. It's likely
that we'll also rename convert_tuples_by_* to denote that these
functions "only" build a map, but that's left for later.
Author: Amit Khandekar and Amit Langote, editorialized by me
Reviewed-By: Amit Langote, Amit Khandekar, Andres Freund
Discussion:
https://postgr.es/m/CAJ3gD9fR0wRNeAE8VqffNTyONS_UfFPRpqxhnD9Q42vZB+Jvpg@mail.gmail.comhttps://postgr.es/m/e4f9d743-cd4b-efb0-7574-da21d86a7f36%40lab.ntt.co.jp
Backpatch: -
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/cc2905e963e950d01cd2cb6c860638ce9506c63d
Modified Files
--------------
src/backend/access/common/tupconvert.c | 182 ++++++++++++++++++++++++---------
src/backend/commands/analyze.c | 2 +-
src/backend/commands/copy.c | 29 ++++--
src/backend/commands/trigger.c | 4 +-
src/backend/executor/execExprInterp.c | 2 +-
src/backend/executor/execMain.c | 79 +++++++-------
src/backend/executor/execPartition.c | 101 +++++++-----------
src/backend/executor/nodeModifyTable.c | 24 +++--
src/include/access/tupconvert.h | 8 +-
src/include/executor/execPartition.h | 18 ++--
src/pl/plpgsql/src/pl_exec.c | 14 +--
11 files changed, 272 insertions(+), 191 deletions(-)
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: andres@anarazel.de
Subject: Re: pgsql: Use slots more widely in tuple mapping code and make naming more
In-Reply-To: <E1g7PZO-0003rj-IZ@gemulon.postgresql.org>
References: <E1g7PZO-0003rj-IZ@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