git.postgresql.org Git - postgresql.git/commitdiff

git projects / postgresql.git / commitdiff
? search:
summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 8aa02b5)
Allow to use HeapTupleData embedded in [Buffer]HeapTupleTableSlot.
2019年2月27日 02:15:59 +0000 (18:15 -0800)
2019年2月27日 02:15:59 +0000 (18:15 -0800)
That avoids having to care about the lifetime of the
HeapTupleHeaderData passed to ExecStore[Buffer]HeapTuple(). That
doesn't make a huge difference for a plain HeapTupleTableSlot, but for
BufferHeapTupleTableSlot it can be a significant advantage, avoiding
the need to materialize slots where it's inconvenient to provide a
HeapTupleData with appropriate lifetime to point to the on-disk tuple.

It's quite possible that we'll want to add support functions for
constructing HeapTuples using that embedded HeapTupleData, but for now
callers do so themselves.

Author: Andres Freund
Discussion: https://postgr.es/m/20180703070645.wchpu5muyto5n647@alap3.anarazel.de


diff --git a/src/include/executor/tuptable.h b/src/include/executor/tuptable.h
index 8da0b84dd7e9c1909d97f02384cc144464ba8fd0..1e94beafac5b84601200b40fe39383b9b17c6a78 100644 (file)
--- a/src/include/executor/tuptable.h
+++ b/src/include/executor/tuptable.h
@@ -16,6 +16,7 @@
#include "access/htup.h"
#include "access/tupdesc.h"
+#include "access/htup_details.h"
#include "storage/buf.h"
/*----------
@@ -246,6 +247,7 @@ typedef struct HeapTupleTableSlot
HeapTuple tuple; /* physical tuple */
#define FIELDNO_HEAPTUPLETABLESLOT_OFF 2
uint32 off; /* saved state for slot_deform_heap_tuple */
+ HeapTupleData tupdata; /* optional workspace for storing tuple */
} HeapTupleTableSlot;
/* heap tuple residing in a buffer */
This is the main PostgreSQL git repository.
RSS Atom

AltStyle によって変換されたページ (->オリジナル) /