summaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorAndres Freund2018-11-16 18:25:34 +0000
committerAndres Freund2018-11-16 18:29:01 +0000
commita7aa608e0f5910f9c73a530a66142c08e3d9043a (patch)
treecfe884e427c23fcf7a629bb7cb8276bf2b43e457 /src/include
parent3f2393edefa5ef2b6970a5a2fa2c7e9c55cc10cf (diff)
Inline hot path of slot_getsomeattrs().
This yields a minor speedup, which roughly balances the loss from the upcoming introduction of callbacks to do some operations on slots. Author: Andres Freund Discussion: https://postgr.es/m/[email protected]
Diffstat (limited to 'src/include')
-rw-r--r--src/include/executor/tuptable.h13
-rw-r--r--src/include/jit/llvmjit.h2
2 files changed, 13 insertions, 2 deletions
diff --git a/src/include/executor/tuptable.h b/src/include/executor/tuptable.h
index 7e6b40acb1e..9470d385309 100644
--- a/src/include/executor/tuptable.h
+++ b/src/include/executor/tuptable.h
@@ -219,7 +219,6 @@ extern void slot_getmissingattrs(TupleTableSlot *slot, int startAttNum,
int lastAttNum);
extern Datum slot_getattr(TupleTableSlot *slot, int attnum,
bool *isnull);
-extern void slot_getsomeattrs(TupleTableSlot *slot, int attnum);
/* in access/common/heaptuple.c */
extern bool slot_attisnull(TupleTableSlot *slot, int attnum);
@@ -227,10 +226,22 @@ extern bool slot_getsysattr(TupleTableSlot *slot, int attnum,
Datum *value, bool *isnull);
extern Datum getmissingattr(TupleDesc tupleDesc,
int attnum, bool *isnull);
+extern void slot_getsomeattrs_int(TupleTableSlot *slot, int attnum);
#ifndef FRONTEND
/*
+ * This function forces the entries of the slot's Datum/isnull arrays to be
+ * valid at least up through the attnum'th entry.
+ */
+static inline void
+slot_getsomeattrs(TupleTableSlot *slot, int attnum)
+{
+ if (slot->tts_nvalid < attnum)
+ slot_getsomeattrs_int(slot, attnum);
+}
+
+/*
* slot_getallattrs
* This function forces all the entries of the slot's Datum/isnull
* arrays to be valid. The caller may then extract data directly
diff --git a/src/include/jit/llvmjit.h b/src/include/jit/llvmjit.h
index 3eae5e68319..05c9740bc5e 100644
--- a/src/include/jit/llvmjit.h
+++ b/src/include/jit/llvmjit.h
@@ -77,8 +77,8 @@ extern LLVMTypeRef StructAggStatePerGroupData;
extern LLVMValueRef AttributeTemplate;
extern LLVMValueRef FuncStrlen;
extern LLVMValueRef FuncVarsizeAny;
-extern LLVMValueRef FuncSlotGetsomeattrs;
extern LLVMValueRef FuncSlotGetmissingattrs;
+extern LLVMValueRef FuncSlotGetsomeattrsInt;
extern LLVMValueRef FuncMakeExpandedObjectReadOnlyInternal;
extern LLVMValueRef FuncExecEvalArrayRefSubscript;
extern LLVMValueRef FuncExecEvalSysVar;