aboutsummaryrefslogtreecommitdiff
path: root/src/include/nodes/execnodes.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/include/nodes/execnodes.h')
-rw-r--r--src/include/nodes/execnodes.h49
1 files changed, 38 insertions, 11 deletions
diff --git a/src/include/nodes/execnodes.h b/src/include/nodes/execnodes.h
index 63e864e4636..f70847798e6 100644
--- a/src/include/nodes/execnodes.h
+++ b/src/include/nodes/execnodes.h
@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/include/nodes/execnodes.h,v 1.141 2005/11/22 18:17:30 momjian Exp $
+ * $PostgreSQL: pgsql/src/include/nodes/execnodes.h,v 1.142 2005/11/25 19:47:50 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -871,16 +871,37 @@ typedef struct ScanState
*/
typedef ScanState SeqScanState;
+/*
+ * These structs store information about index quals that don't have simple
+ * constant right-hand sides. See comments for ExecIndexBuildScanKeys()
+ * for discussion.
+ */
+typedef struct
+{
+ ScanKey scan_key; /* scankey to put value into */
+ ExprState *key_expr; /* expr to evaluate to get value */
+} IndexRuntimeKeyInfo;
+
+typedef struct
+{
+ ScanKey scan_key; /* scankey to put value into */
+ ExprState *array_expr; /* expr to evaluate to get array value */
+ int next_elem; /* next array element to use */
+ int num_elems; /* number of elems in current array value */
+ Datum *elem_values; /* array of num_elems Datums */
+ bool *elem_nulls; /* array of num_elems is-null flags */
+} IndexArrayKeyInfo;
+
/* ----------------
* IndexScanState information
*
* indexqualorig execution state for indexqualorig expressions
* ScanKeys Skey structures to scan index rel
* NumScanKeys number of Skey structs
- * RuntimeKeyInfo array of exprstates for Skeys
- * that will be evaluated at runtime
- * RuntimeContext expr context for evaling runtime Skeys
+ * RuntimeKeys info about Skeys that must be evaluated at runtime
+ * NumRuntimeKeys number of RuntimeKeys structs
* RuntimeKeysReady true if runtime Skeys have been computed
+ * RuntimeContext expr context for evaling runtime Skeys
* RelationDesc index relation descriptor
* ScanDesc index scan descriptor
* ----------------
@@ -891,9 +912,10 @@ typedef struct IndexScanState
List *indexqualorig;
ScanKey iss_ScanKeys;
int iss_NumScanKeys;
- ExprState **iss_RuntimeKeyInfo;
- ExprContext *iss_RuntimeContext;
+ IndexRuntimeKeyInfo *iss_RuntimeKeys;
+ int iss_NumRuntimeKeys;
bool iss_RuntimeKeysReady;
+ ExprContext *iss_RuntimeContext;
Relation iss_RelationDesc;
IndexScanDesc iss_ScanDesc;
} IndexScanState;
@@ -904,10 +926,12 @@ typedef struct IndexScanState
* result bitmap to return output into, or NULL
* ScanKeys Skey structures to scan index rel
* NumScanKeys number of Skey structs
- * RuntimeKeyInfo array of exprstates for Skeys
- * that will be evaluated at runtime
- * RuntimeContext expr context for evaling runtime Skeys
+ * RuntimeKeys info about Skeys that must be evaluated at runtime
+ * NumRuntimeKeys number of RuntimeKeys structs
+ * ArrayKeys info about Skeys that come from ScalarArrayOpExprs
+ * NumArrayKeys number of ArrayKeys structs
* RuntimeKeysReady true if runtime Skeys have been computed
+ * RuntimeContext expr context for evaling runtime Skeys
* RelationDesc index relation descriptor
* ScanDesc index scan descriptor
* ----------------
@@ -918,9 +942,12 @@ typedef struct BitmapIndexScanState
TIDBitmap *biss_result;
ScanKey biss_ScanKeys;
int biss_NumScanKeys;
- ExprState **biss_RuntimeKeyInfo;
- ExprContext *biss_RuntimeContext;
+ IndexRuntimeKeyInfo *biss_RuntimeKeys;
+ int biss_NumRuntimeKeys;
+ IndexArrayKeyInfo *biss_ArrayKeys;
+ int biss_NumArrayKeys;
bool biss_RuntimeKeysReady;
+ ExprContext *biss_RuntimeContext;
Relation biss_RelationDesc;
IndexScanDesc biss_ScanDesc;
} BitmapIndexScanState;