diff options
| author | Tom Lane <tgl@sss.pgh.pa.us> | 2005-04-19 22:35:18 +0000 |
|---|---|---|
| committer | Tom Lane <tgl@sss.pgh.pa.us> | 2005-04-19 22:35:18 +0000 |
| commit | 4a8c5d0375f17d8d961a280cbb640996aaa8bf0d (patch) | |
| tree | d12840ac104b45911406a533274add8456300815 /src/include/nodes/relation.h | |
| parent | 04ce41ca622c40c0501de1e31cf888f64f1736bf (diff) | |
| download | postgresql-4a8c5d0375f17d8d961a280cbb640996aaa8bf0d.tar.gz | |
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/relation.h')
| -rw-r--r-- | src/include/nodes/relation.h | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/src/include/nodes/relation.h b/src/include/nodes/relation.h index 4698e4d8cb..2e4e1834fe 100644 --- a/src/include/nodes/relation.h +++ b/src/include/nodes/relation.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/relation.h,v 1.104 2005/03/27 06:29:45 tgl Exp $ + * $PostgreSQL: pgsql/src/include/nodes/relation.h,v 1.105 2005/04/19 22:35:17 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -342,6 +342,9 @@ typedef struct Path * tuples matched during any scan. (The executor is smart enough not to return * the same tuple more than once, even if it is matched in multiple scans.) * + * XXX bitmap index scans will probably obviate the need for plain OR + * indexscans, allowing a lot of this to be simplified. + * * 'indexinfo' is a list of IndexOptInfo nodes, one per scan to be performed. * * 'indexclauses' is a list of index qualifications, also one per scan. @@ -390,6 +393,30 @@ typedef struct IndexPath } IndexPath; /* + * BitmapHeapPath represents one or more indexscans that generate TID bitmaps + * instead of directly accessing the heap, followed by AND/OR combinations + * to produce a single bitmap, followed by a heap scan that uses the bitmap. + * Note that the output is always considered unordered, since it will come + * out in physical heap order no matter what the underlying indexes did. + * + * The individual indexscans are represented by IndexPath nodes, and any + * logic on top of them is represented by regular AND and OR expressions. + * Notice that we can use the same IndexPath node both to represent an + * ordered index scan, and as the child of a BitmapHeapPath that represents + * scanning the same index in an unordered way. + * + * BitmapHeapPaths can be nestloop inner indexscans. The isjoininner and + * rows fields serve the same purpose as for plain IndexPaths. + */ +typedef struct BitmapHeapPath +{ + Path path; + Node *bitmapqual; /* the IndexPath/AND/OR tree */ + bool isjoininner; /* T if it's a nestloop inner scan */ + double rows; /* estimated number of result tuples */ +} BitmapHeapPath; + +/* * TidPath represents a scan by TID * * tideval is an implicitly OR'ed list of quals of the form CTID = something. |
