1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-05 07:21:24 +03:00

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.
This commit is contained in:
Tom Lane
2005-04-19 22:35:18 +00:00
parent 04ce41ca62
commit 4a8c5d0375
30 changed files with 2783 additions and 76 deletions

View File

@ -15,7 +15,7 @@
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/nodes/copyfuncs.c,v 1.301 2005/04/07 01:51:38 neilc Exp $
* $PostgreSQL: pgsql/src/backend/nodes/copyfuncs.c,v 1.302 2005/04/19 22:35:13 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@ -148,6 +148,48 @@ _copyAppend(Append *from)
return newnode;
}
/*
* _copyBitmapAnd
*/
static BitmapAnd *
_copyBitmapAnd(BitmapAnd *from)
{
BitmapAnd *newnode = makeNode(BitmapAnd);
/*
* copy node superclass fields
*/
CopyPlanFields((Plan *) from, (Plan *) newnode);
/*
* copy remainder of node
*/
COPY_NODE_FIELD(bitmapplans);
return newnode;
}
/*
* _copyBitmapOr
*/
static BitmapOr *
_copyBitmapOr(BitmapOr *from)
{
BitmapOr *newnode = makeNode(BitmapOr);
/*
* copy node superclass fields
*/
CopyPlanFields((Plan *) from, (Plan *) newnode);
/*
* copy remainder of node
*/
COPY_NODE_FIELD(bitmapplans);
return newnode;
}
/*
* CopyScanFields
@ -222,6 +264,52 @@ _copyIndexScan(IndexScan *from)
return newnode;
}
/*
* _copyBitmapIndexScan
*/
static BitmapIndexScan *
_copyBitmapIndexScan(BitmapIndexScan *from)
{
BitmapIndexScan *newnode = makeNode(BitmapIndexScan);
/*
* copy node superclass fields
*/
CopyScanFields((Scan *) from, (Scan *) newnode);
/*
* copy remainder of node
*/
COPY_SCALAR_FIELD(indxid);
COPY_NODE_FIELD(indxqual);
COPY_NODE_FIELD(indxqualorig);
COPY_NODE_FIELD(indxstrategy);
COPY_NODE_FIELD(indxsubtype);
return newnode;
}
/*
* _copyBitmapHeapScan
*/
static BitmapHeapScan *
_copyBitmapHeapScan(BitmapHeapScan *from)
{
BitmapHeapScan *newnode = makeNode(BitmapHeapScan);
/*
* copy node superclass fields
*/
CopyScanFields((Scan *) from, (Scan *) newnode);
/*
* copy remainder of node
*/
COPY_NODE_FIELD(bitmapqualorig);
return newnode;
}
/*
* _copyTidScan
*/
@ -2598,6 +2686,12 @@ copyObject(void *from)
case T_Append:
retval = _copyAppend(from);
break;
case T_BitmapAnd:
retval = _copyBitmapAnd(from);
break;
case T_BitmapOr:
retval = _copyBitmapOr(from);
break;
case T_Scan:
retval = _copyScan(from);
break;
@ -2607,6 +2701,12 @@ copyObject(void *from)
case T_IndexScan:
retval = _copyIndexScan(from);
break;
case T_BitmapIndexScan:
retval = _copyBitmapIndexScan(from);
break;
case T_BitmapHeapScan:
retval = _copyBitmapHeapScan(from);
break;
case T_TidScan:
retval = _copyTidScan(from);
break;