Thread flags through begin-scan APIs
Add an AM user-settable flags parameter to several of the table scan
functions, one table AM callback, and index_beginscan(). This allows
users to pass additional context to be used when building the scan
descriptors.
For index scans, a new flags field is added to IndexFetchTableData, and
the heap AM saves the caller-provided flags there.
This introduces an extension point for follow-up work to pass per-scan
information (such as whether the relation is read-only for the current
query) from the executor to the AM layer.
Author: Melanie Plageman <melanieplageman@gmail.com>
Reviewed-by: Andres Freund <andres@anarazel.de>
Reviewed-by: Tomas Vondra <tomas@vondra.me>
Reviewed-by: David Rowley <dgrowleyml@gmail.com>
Reviewed-by: Chao Li <li.evan.chao@gmail.com>
Discussion: https://postgr.es/m/2be31f17-5405-4de9-8d73-90ebc322f7d8%40vondra.me
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/dcd8cc1c852cac4e65d336a79afb6b9eb9700ae1
Modified Files
--------------
contrib/pgrowlocks/pgrowlocks.c | 2 +-
src/backend/access/brin/brin.c | 3 +-
src/backend/access/gin/gininsert.c | 3 +-
src/backend/access/heap/heapam_handler.c | 9 ++-
src/backend/access/index/genam.c | 6 +-
src/backend/access/index/indexam.c | 13 ++--
src/backend/access/nbtree/nbtsort.c | 3 +-
src/backend/access/table/tableam.c | 22 ++++---
src/backend/commands/constraint.c | 3 +-
src/backend/commands/copyto.c | 3 +-
src/backend/commands/tablecmds.c | 13 ++--
src/backend/commands/typecmds.c | 6 +-
src/backend/executor/execIndexing.c | 4 +-
src/backend/executor/execReplication.c | 12 ++--
src/backend/executor/nodeBitmapHeapscan.c | 3 +-
src/backend/executor/nodeIndexonlyscan.c | 9 ++-
src/backend/executor/nodeIndexscan.c | 12 ++--
src/backend/executor/nodeSamplescan.c | 3 +-
src/backend/executor/nodeSeqscan.c | 9 ++-
src/backend/executor/nodeTidrangescan.c | 7 +-
src/backend/partitioning/partbounds.c | 3 +-
src/backend/utils/adt/selfuncs.c | 3 +-
src/include/access/genam.h | 6 +-
src/include/access/heapam.h | 5 +-
src/include/access/relscan.h | 6 ++
src/include/access/tableam.h | 103 ++++++++++++++++++++++--------
26 files changed, 185 insertions(+), 86 deletions(-)