diff options
| author | Andres Freund <andres@anarazel.de> | 2018-11-15 14:26:14 -0800 |
|---|---|---|
| committer | Andres Freund <andres@anarazel.de> | 2018-11-15 14:31:12 -0800 |
| commit | 763f2edd92095b1ca2f4476da073a28505c13820 (patch) | |
| tree | b053d30c95bf1ccf8b291462d654e4726624fe29 /src/include/executor | |
| parent | 7ac0069fb880b9b64223f104058c82773321851c (diff) | |
Rejigger materializing and fetching a HeapTuple from a slot.
Previously materializing a slot always returned a HeapTuple. As
current work aims to reduce the reliance on HeapTuples (so other
storage systems can work efficiently), that needs to change. Thus
split the tasks of materializing a slot (i.e. making it independent
from the underlying storage / other memory contexts) from fetching a
HeapTuple from the slot. For brevity, allow to fetch a HeapTuple from
a slot and materializing the slot at the same time, controlled by a
parameter.
For now some callers of ExecFetchSlotHeapTuple, with materialize =
true, expect that changes to the heap tuple will be reflected in the
underlying slot. Those places will be adapted in due course, so while
not pretty, that's OK for now.
Also rename ExecFetchSlotTuple to ExecFetchSlotHeapTupleDatum and
ExecFetchSlotTupleDatum to ExecFetchSlotHeapTupleDatum, as it's likely
that future storage methods will need similar methods. There already
is ExecFetchSlotMinimalTuple, so the new names make the naming scheme
more coherent.
Author: Ashutosh Bapat and Andres Freund, with changes by Amit Khandekar
Discussion: https://postgr.es/m/20181105210039.hh4vvi4vwoq5ba2q@alap3.anarazel.de
Diffstat (limited to 'src/include/executor')
| -rw-r--r-- | src/include/executor/tuptable.h | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/include/executor/tuptable.h b/src/include/executor/tuptable.h index b41b400ef18..8bfa73c30ea 100644 --- a/src/include/executor/tuptable.h +++ b/src/include/executor/tuptable.h @@ -185,10 +185,11 @@ extern TupleTableSlot *ExecStoreVirtualTuple(TupleTableSlot *slot); extern TupleTableSlot *ExecStoreAllNullTuple(TupleTableSlot *slot); extern HeapTuple ExecCopySlotTuple(TupleTableSlot *slot); extern MinimalTuple ExecCopySlotMinimalTuple(TupleTableSlot *slot); -extern HeapTuple ExecFetchSlotTuple(TupleTableSlot *slot); -extern MinimalTuple ExecFetchSlotMinimalTuple(TupleTableSlot *slot); -extern Datum ExecFetchSlotTupleDatum(TupleTableSlot *slot); -extern HeapTuple ExecMaterializeSlot(TupleTableSlot *slot); +extern HeapTuple ExecFetchSlotHeapTuple(TupleTableSlot *slot, bool materialize, bool *shoulFree); +extern MinimalTuple ExecFetchSlotMinimalTuple(TupleTableSlot *slot, + bool *shouldFree); +extern Datum ExecFetchSlotHeapTupleDatum(TupleTableSlot *slot); +extern void ExecMaterializeSlot(TupleTableSlot *slot); extern TupleTableSlot *ExecCopySlot(TupleTableSlot *dstslot, TupleTableSlot *srcslot); extern void slot_getmissingattrs(TupleTableSlot *slot, int startAttNum, |
