aboutsummaryrefslogtreecommitdiff
path: root/src/backend/nodes/outfuncs.c
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/backend/nodes/outfuncs.c
parent04ce41ca622c40c0501de1e31cf888f64f1736bf (diff)
downloadpostgresql-4a8c5d0375f17d8d961a280cbb640996aaa8bf0d.tar.gz
postgresql-4a8c5d0375f17d8d961a280cbb640996aaa8bf0d.zip
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/backend/nodes/outfuncs.c')
-rw-r--r--src/backend/nodes/outfuncs.c76
1 files changed, 72 insertions, 4 deletions
diff --git a/src/backend/nodes/outfuncs.c b/src/backend/nodes/outfuncs.c
index 91a7abf5749..c241b113674 100644
--- a/src/backend/nodes/outfuncs.c
+++ b/src/backend/nodes/outfuncs.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/nodes/outfuncs.c,v 1.246 2005/04/06 16:34:05 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/nodes/outfuncs.c,v 1.247 2005/04/19 22:35:14 tgl Exp $
*
* NOTES
* Every node type that can appear in stored rules' parsetrees *must*
@@ -309,6 +309,26 @@ _outAppend(StringInfo str, Append *node)
}
static void
+_outBitmapAnd(StringInfo str, BitmapAnd *node)
+{
+ WRITE_NODE_TYPE("BITMAPAND");
+
+ _outPlanInfo(str, (Plan *) node);
+
+ WRITE_NODE_FIELD(bitmapplans);
+}
+
+static void
+_outBitmapOr(StringInfo str, BitmapOr *node)
+{
+ WRITE_NODE_TYPE("BITMAPOR");
+
+ _outPlanInfo(str, (Plan *) node);
+
+ WRITE_NODE_FIELD(bitmapplans);
+}
+
+static void
_outScan(StringInfo str, Scan *node)
{
WRITE_NODE_TYPE("SCAN");
@@ -341,6 +361,30 @@ _outIndexScan(StringInfo str, IndexScan *node)
}
static void
+_outBitmapIndexScan(StringInfo str, BitmapIndexScan *node)
+{
+ WRITE_NODE_TYPE("BITMAPINDEXSCAN");
+
+ _outScanInfo(str, (Scan *) node);
+
+ WRITE_OID_FIELD(indxid);
+ WRITE_NODE_FIELD(indxqual);
+ WRITE_NODE_FIELD(indxqualorig);
+ WRITE_NODE_FIELD(indxstrategy);
+ WRITE_NODE_FIELD(indxsubtype);
+}
+
+static void
+_outBitmapHeapScan(StringInfo str, BitmapHeapScan *node)
+{
+ WRITE_NODE_TYPE("BITMAPHEAPSCAN");
+
+ _outScanInfo(str, (Scan *) node);
+
+ WRITE_NODE_FIELD(bitmapqualorig);
+}
+
+static void
_outTidScan(StringInfo str, TidScan *node)
{
WRITE_NODE_TYPE("TIDSCAN");
@@ -968,9 +1012,6 @@ _outPath(StringInfo str, Path *node)
_outPathInfo(str, (Path *) node);
}
-/*
- * IndexPath is a subclass of Path.
- */
static void
_outIndexPath(StringInfo str, IndexPath *node)
{
@@ -987,6 +1028,18 @@ _outIndexPath(StringInfo str, IndexPath *node)
}
static void
+_outBitmapHeapPath(StringInfo str, BitmapHeapPath *node)
+{
+ WRITE_NODE_TYPE("BITMAPHEAPPATH");
+
+ _outPathInfo(str, (Path *) node);
+
+ WRITE_NODE_FIELD(bitmapqual);
+ WRITE_BOOL_FIELD(isjoininner);
+ WRITE_FLOAT_FIELD(rows, "%.0f");
+}
+
+static void
_outTidPath(StringInfo str, TidPath *node)
{
WRITE_NODE_TYPE("TIDPATH");
@@ -1620,6 +1673,12 @@ _outNode(StringInfo str, void *obj)
case T_Append:
_outAppend(str, obj);
break;
+ case T_BitmapAnd:
+ _outBitmapAnd(str, obj);
+ break;
+ case T_BitmapOr:
+ _outBitmapOr(str, obj);
+ break;
case T_Scan:
_outScan(str, obj);
break;
@@ -1629,6 +1688,12 @@ _outNode(StringInfo str, void *obj)
case T_IndexScan:
_outIndexScan(str, obj);
break;
+ case T_BitmapIndexScan:
+ _outBitmapIndexScan(str, obj);
+ break;
+ case T_BitmapHeapScan:
+ _outBitmapHeapScan(str, obj);
+ break;
case T_TidScan:
_outTidScan(str, obj);
break;
@@ -1783,6 +1848,9 @@ _outNode(StringInfo str, void *obj)
case T_IndexPath:
_outIndexPath(str, obj);
break;
+ case T_BitmapHeapPath:
+ _outBitmapHeapPath(str, obj);
+ break;
case T_TidPath:
_outTidPath(str, obj);
break;