From: Andres Freund <andres@anarazel.de>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Store table oid and tuple's tid in tuple slots directly.
Date: Wed, 27 Feb 2019 04:41:28 +0000
Message-ID: <E1gyr28-0004d7-5n@gemulon.postgresql.org> (raw)
Store table oid and tuple's tid in tuple slots directly.
After the introduction of tuple table slots all table AMs need to
support returning the table oid of the tuple stored in a slot created
by said AM. It does not make sense to re-implement that in every AM,
therefore move handling of table OIDs into the TupleTableSlot
structure itself. It's possible that we, at a later date, might want
to get rid of HeapTupleData.t_tableOid entirely, but doing so before
the abstractions for table AMs are integrated turns out to be too
hard, so delay that for now.
Similarly, every AM needs to support the concept of a tuple
identifier (tid / item pointer) for its tuples. It's quite possible
that we'll generalize the exact form of a tid at a future point (to
allow for things like index organized tables), but for now many parts
of the code know about tids, so there's not much point in abstracting
tids away. Therefore also move into slot (rather than providing API to
set/get the tid associated with the tuple in a slot).
Once table AM includes insert/updating/deleting tuples, the
responsibility to set the correct tid after such an action will move
into that. After that change, code doing such modifications, should
not have to deal with HeapTuples directly anymore.
Author: Andres Freund, Haribabu Kommi and Ashutosh Bapat
Discussion: https://postgr.es/m/20180703070645.wchpu5muyto5n647@alap3.anarazel.de
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/b8d71745eac0a12740a70dc78cbcdedadade37f8
Modified Files
--------------
src/backend/commands/copy.c | 18 ++++++-----
src/backend/commands/tablecmds.c | 3 ++
src/backend/executor/execReplication.c | 2 ++
src/backend/executor/execTuples.c | 7 +++++
src/backend/executor/nodeForeignscan.c | 12 ++-----
src/backend/executor/nodeModifyTable.c | 57 +++++++++++++++++-----------------
src/include/executor/tuptable.h | 14 +++++++++
7 files changed, 69 insertions(+), 44 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: Store table oid and tuple's tid in tuple slots directly.
In-Reply-To: <E1gyr28-0004d7-5n@gemulon.postgresql.org>
References: <E1gyr28-0004d7-5n@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