summaryrefslogtreecommitdiff
path: root/src/include/nodes/execnodes.h
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2005-04-19 22:35:18 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2005-04-19 22:35:18 +0000
commit4a8c5d0375f17d8d961a280cbb640996aaa8bf0d (patch)
treed12840ac104b45911406a533274add8456300815 /src/include/nodes/execnodes.h
parent04ce41ca622c40c0501de1e31cf888f64f1736bf (diff)
Create executor and planner-backend support for decoupled heap and index
scans, using in-memory tuple ID bitmaps as the intermediary. The planner frontend (path creation and cost estimation) is not there yet, so none of this code can be executed. I have tested it using some hacked planner code that is far too ugly to see the light of day, however. Committing now so that the bulk of the infrastructure changes go in before the tree drifts under me.
Diffstat (limited to 'src/include/nodes/execnodes.h')
-rw-r--r--src/include/nodes/execnodes.h72
1 files changed, 71 insertions, 1 deletions
diff --git a/src/include/nodes/execnodes.h b/src/include/nodes/execnodes.h
index da82daaac98..a5176c2f955 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.125 2005/03/25 21:58:00 tgl Exp $
+ * $PostgreSQL: pgsql/src/include/nodes/execnodes.h,v 1.126 2005/04/19 22:35:17 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -20,6 +20,7 @@
#include "nodes/bitmapset.h"
#include "nodes/params.h"
#include "nodes/plannodes.h"
+#include "nodes/tidbitmap.h"
#include "utils/hsearch.h"
#include "utils/tuplestore.h"
@@ -803,6 +804,28 @@ typedef struct AppendState
int as_lastplan;
} AppendState;
+/* ----------------
+ * BitmapAndState information
+ * ----------------
+ */
+typedef struct BitmapAndState
+{
+ PlanState ps; /* its first field is NodeTag */
+ PlanState **bitmapplans; /* array of PlanStates for my inputs */
+ int nplans; /* number of input plans */
+} BitmapAndState;
+
+/* ----------------
+ * BitmapOrState information
+ * ----------------
+ */
+typedef struct BitmapOrState
+{
+ PlanState ps; /* its first field is NodeTag */
+ PlanState **bitmapplans; /* array of PlanStates for my inputs */
+ int nplans; /* number of input plans */
+} BitmapOrState;
+
/* ----------------------------------------------------------------
* Scan State Information
* ----------------------------------------------------------------
@@ -876,6 +899,53 @@ typedef struct IndexScanState
} IndexScanState;
/* ----------------
+ * BitmapIndexScanState information
+ *
+ * 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
+ * RuntimeKeysReady true if runtime Skeys have been computed
+ * RelationDesc relation descriptor
+ * ScanDesc scan descriptor
+ * ----------------
+ */
+typedef struct BitmapIndexScanState
+{
+ ScanState ss; /* its first field is NodeTag */
+ ScanKey biss_ScanKeys;
+ int biss_NumScanKeys;
+ ExprState **biss_RuntimeKeyInfo;
+ ExprContext *biss_RuntimeContext;
+ bool biss_RuntimeKeysReady;
+ Relation biss_RelationDesc;
+ IndexScanDesc biss_ScanDesc;
+} BitmapIndexScanState;
+
+/* ----------------
+ * BitmapHeapScanState information
+ *
+ * bitmapqualorig execution state for bitmapqualorig expressions
+ * tbm bitmap obtained from child index scan(s)
+ * tbmres current-page data
+ * curslot current tbmres index or tuple offset on page
+ * minslot lowest tbmres index or tuple offset to try
+ * maxslot highest tbmres index or tuple offset to try
+ * ----------------
+ */
+typedef struct BitmapHeapScanState
+{
+ ScanState ss; /* its first field is NodeTag */
+ List *bitmapqualorig;
+ TIDBitmap *tbm;
+ TBMIterateResult *tbmres;
+ int curslot;
+ int minslot;
+ int maxslot;
+} BitmapHeapScanState;
+
+/* ----------------
* TidScanState information
*
* NumTids number of tids in this scan