From 4a8c5d0375f17d8d961a280cbb640996aaa8bf0d Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Tue, 19 Apr 2005 22:35:18 +0000 Subject: 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. --- src/backend/optimizer/util/pathnode.c | 35 ++++++++++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) (limited to 'src/backend/optimizer/util/pathnode.c') diff --git a/src/backend/optimizer/util/pathnode.c b/src/backend/optimizer/util/pathnode.c index 14b62b80fc8..ec0fc8a29ab 100644 --- a/src/backend/optimizer/util/pathnode.c +++ b/src/backend/optimizer/util/pathnode.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/optimizer/util/pathnode.c,v 1.115 2005/04/06 16:34:06 tgl Exp $ + * $PostgreSQL: pgsql/src/backend/optimizer/util/pathnode.c,v 1.116 2005/04/19 22:35:17 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -471,6 +471,39 @@ create_index_path(Query *root, return pathnode; } +/* + * create_bitmap_heap_path + * Creates a path node for a bitmap scan. + * + * 'bitmapqual' is an AND/OR tree of IndexPath nodes. + */ +BitmapHeapPath * +create_bitmap_heap_path(Query *root, + RelOptInfo *rel, + Node *bitmapqual) +{ + BitmapHeapPath *pathnode = makeNode(BitmapHeapPath); + + pathnode->path.pathtype = T_BitmapHeapScan; + pathnode->path.parent = rel; + pathnode->path.pathkeys = NIL; /* always unordered */ + + pathnode->bitmapqual = bitmapqual; + + /* It's not an innerjoin path. */ + pathnode->isjoininner = false; + + /* + * The number of rows is the same as the parent rel's estimate, since + * this isn't a join inner indexscan. + */ + pathnode->rows = rel->rows; + + cost_bitmap_scan(&pathnode->path, root, rel, bitmapqual, false); + + return pathnode; +} + /* * create_tidscan_path * Creates a path corresponding to a tid_direct scan, returning the -- cgit v1.2.3