pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andres Freund <andres@anarazel.de>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Store tuples for EvalPlanQual in slots, rather than as HeapTuple
Date: Fri, 01 Mar 2019 18:44:46 +0000
Message-ID: <E1gzn9K-0002vJ-QE@gemulon.postgresql.org> (raw)

Store tuples for EvalPlanQual in slots, rather than as HeapTuples.

For the upcoming pluggable table access methods it's quite
inconvenient to store tuples as HeapTuples, as that'd require
converting tuples from a their native format into HeapTuples. Instead
use slots to manage epq tuples.

To fit into that scheme, change the foreign data wrapper callback
RefetchForeignRow, to store the tuple in a slot. Insist on using the
caller provided slot, so it conveniently can be stored in the
corresponding EPQ slot.  As there is no in core user of
RefetchForeignRow, that change was done blindly, but we plan to test
that soon.

To avoid duplicating that work for row locks, move row locks to just
directly use the EPQ slots - it previously temporarily stored tuples
in LockRowsState.lr_curtuples, but that doesn't seem beneficial, given
we'd possibly end up with a significant number of additional slots.

The behaviour of es_epqTupleSet[rti -1] is now checked by
es_epqTupleSlot[rti -1] != NULL, as that is distinguishable from a
slot containing an empty tuple.

Author: Andres Freund, Haribabu Kommi, Ashutosh Bapat
Discussion: https://postgr.es/m/20180703070645.wchpu5muyto5n647@alap3.anarazel.de

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/ad0bda5d24ea2bcc72b5e50020e3c79bab10836b

Modified Files
--------------
doc/src/sgml/fdwhandler.sgml             |  24 ++--
src/backend/executor/execMain.c          | 183 +++++++++++++------------------
src/backend/executor/execScan.c          |  16 ++-
src/backend/executor/execTuples.c        |  26 +++++
src/backend/executor/execUtils.c         |   3 +-
src/backend/executor/nodeIndexonlyscan.c |   8 +-
src/backend/executor/nodeIndexscan.c     |   8 +-
src/backend/executor/nodeLockRows.c      |  92 ++++++----------
src/backend/executor/nodeModifyTable.c   |   2 +-
src/include/executor/executor.h          |  10 +-
src/include/executor/tuptable.h          |   1 +
src/include/foreign/fdwapi.h             |   9 +-
src/include/nodes/execnodes.h            |  18 ++-
13 files changed, 188 insertions(+), 212 deletions(-)



Message-ID: <E1gzn9K-0002vJ-QE@gemulon.postgresql.org>
Permalink:  ../E1gzn9K-0002vJ-QE@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1gzn9K-0002vJ-QE@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: andres@anarazel.de
  Subject: Re: pgsql: Store tuples for EvalPlanQual in slots, rather than as HeapTuple
  In-Reply-To: <E1gzn9K-0002vJ-QE@gemulon.postgresql.org>
  References: <E1gzn9K-0002vJ-QE@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