summaryrefslogtreecommitdiff
path: root/src/include/executor/executor.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/include/executor/executor.h')
-rw-r--r--src/include/executor/executor.h34
1 files changed, 34 insertions, 0 deletions
diff --git a/src/include/executor/executor.h b/src/include/executor/executor.h
index 0db5d18ba22..69396a9d7f8 100644
--- a/src/include/executor/executor.h
+++ b/src/include/executor/executor.h
@@ -158,6 +158,40 @@ extern TupleHashEntry FindTupleHashEntry(TupleHashTable hashtable,
ExprState *hashexpr);
extern void ResetTupleHashTable(TupleHashTable hashtable);
+#ifndef FRONTEND
+/*
+ * Return size of the hash bucket. Useful for estimating memory usage.
+ */
+static inline size_t
+TupleHashEntrySize(void)
+{
+ return sizeof(TupleHashEntryData);
+}
+
+/*
+ * Return tuple from hash entry.
+ */
+static inline MinimalTuple
+TupleHashEntryGetTuple(TupleHashEntry entry)
+{
+ return entry->firstTuple;
+}
+
+/*
+ * Get a pointer into the additional space allocated for this entry. The
+ * memory will be maxaligned and zeroed.
+ *
+ * The amount of space available is the additionalsize requested in the call
+ * to BuildTupleHashTable(). If additionalsize was specified as zero, return
+ * NULL.
+ */
+static inline void *
+TupleHashEntryGetAdditional(TupleHashTable hashtable, TupleHashEntry entry)
+{
+ return entry->additional;
+}
+#endif
+
/*
* prototypes from functions in execJunk.c
*/