postgresql/src/backend
Andres Freund 1a0586de36 Introduce notion of different types of slots (without implementing them).
Upcoming work intends to allow pluggable ways to introduce new ways of
storing table data. Accessing those table access methods from the
executor requires TupleTableSlots to be carry tuples in the native
format of such storage methods; otherwise there'll be a significant
conversion overhead.

Different access methods will require different data to store tuples
efficiently (just like virtual, minimal, heap already require fields
in TupleTableSlot). To allow that without requiring additional pointer
indirections, we want to have different structs (embedding
TupleTableSlot) for different types of slots.  Thus different types of
slots are needed, which requires adapting creators of slots.

The slot that most efficiently can represent a type of tuple in an
executor node will often depend on the type of slot a child node
uses. Therefore we need to track the type of slot is returned by
nodes, so parent slots can create slots based on that.

Relatedly, JIT compilation of tuple deforming needs to know which type
of slot a certain expression refers to, so it can create an
appropriate deforming function for the type of tuple in the slot.

But not all nodes will only return one type of slot, e.g. an append
node will potentially return different types of slots for each of its
subplans.

Therefore add function that allows to query the type of a node's
result slot, and whether it'll always be the same type (whether it's
fixed). This can be queried using ExecGetResultSlotOps().

The scan, result, inner, outer type of slots are automatically
inferred from ExecInitScanTupleSlot(), ExecInitResultSlot(),
left/right subtrees respectively. If that's not correct for a node,
that can be overwritten using new fields in PlanState.

This commit does not introduce the actually abstracted implementation
of different kind of TupleTableSlots, that will be left for a followup
commit.  The different types of slots introduced will, for now, still
use the same backing implementation.

While this already partially invalidates the big comment in
tuptable.h, it seems to make more sense to update it later, when the
different TupleTableSlot implementations actually exist.

Author: Ashutosh Bapat and Andres Freund, with changes by Amit Khandekar
Discussion: https://postgr.es/m/20181105210039.hh4vvi4vwoq5ba2q@alap3.anarazel.de
2018-11-15 22:00:30 -08:00
..
access Introduce notion of different types of slots (without implementing them). 2018-11-15 22:00:30 -08:00
bootstrap Install a check for mis-linking of src/port and src/common functions. 2018-09-09 12:23:23 -04:00
catalog Introduce notion of different types of slots (without implementing them). 2018-11-15 22:00:30 -08:00
commands Introduce notion of different types of slots (without implementing them). 2018-11-15 22:00:30 -08:00
executor Introduce notion of different types of slots (without implementing them). 2018-11-15 22:00:30 -08:00
foreign Correct constness of a few variables. 2018-10-15 21:01:14 -07:00
jit Fixup for b84a6dafbf triggering assert failure in LLVM debug builds. 2018-11-07 14:00:14 -08:00
lib Rename rbtree.c functions to use "rbt" prefix not "rb" prefix. 2018-11-06 13:25:24 -05:00
libpq Fix const correctness warning. 2018-11-13 19:03:02 +13:00
main Update copyright for 2018 2018-01-02 23:30:12 -05:00
nodes Revise attribute handling code on partition creation 2018-11-08 16:22:09 -03:00
optimizer Limit the number of index clauses considered in choose_bitmap_and(). 2018-11-12 11:19:04 -05:00
parser Fix realfailN lexer rules to not make assumptions about input format. 2018-11-13 14:54:41 -05:00
partitioning Introduce notion of different types of slots (without implementing them). 2018-11-15 22:00:30 -08:00
po Translation updates 2018-06-25 12:37:18 +02:00
port Fix spelling errors and typos in comments 2018-11-02 13:56:52 +01:00
postmaster Further adjustment to random() seed initialization. 2018-11-15 17:38:55 +13:00
regex Clean up warnings from -Wimplicit-fallthrough. 2018-05-01 19:35:08 -04:00
replication Introduce notion of different types of slots (without implementing them). 2018-11-15 22:00:30 -08:00
rewrite Change rewriter/planner/executor/plancache to depend on RTE rellockmode. 2018-10-02 14:43:09 -04:00
snowball Sync our Snowball stemmer dictionaries with current upstream. 2018-09-24 17:29:38 -04:00
statistics Fix typos. 2018-08-27 09:32:59 +12:00
storage Use 64 bit type for BufFileSize(). 2018-11-15 13:13:57 +13:00
tcop Introduce notion of different types of slots (without implementing them). 2018-11-15 22:00:30 -08:00
tsearch Make ts_locale.c's character-type functions cope with UTF-16. 2018-11-03 13:56:10 -04:00
utils Introduce notion of different types of slots (without implementing them). 2018-11-15 22:00:30 -08:00
.gitignore Add .gitignore entries for AIX-specific intermediate build artifacts. 2015-07-08 20:44:22 -04:00
Makefile Refactor dlopen() support 2018-09-06 11:33:04 +02:00
common.mk Remove PARTIAL_LINKING build mode. 2018-03-30 17:33:04 -07:00
nls.mk Translation updates 2018-06-25 12:37:18 +02:00