diff options
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/nodes/nodes.h | 4 | ||||
-rw-r--r-- | src/include/nodes/relation.h | 32 | ||||
-rw-r--r-- | src/include/optimizer/cost.h | 9 | ||||
-rw-r--r-- | src/include/optimizer/pathnode.h | 10 |
4 files changed, 46 insertions, 9 deletions
diff --git a/src/include/nodes/nodes.h b/src/include/nodes/nodes.h index 32df3bff0eb..d69734f95e9 100644 --- a/src/include/nodes/nodes.h +++ b/src/include/nodes/nodes.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/nodes.h,v 1.167 2005/04/19 22:35:17 tgl Exp $ + * $PostgreSQL: pgsql/src/include/nodes/nodes.h,v 1.168 2005/04/21 19:18:13 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -170,6 +170,8 @@ typedef enum NodeTag T_Path, T_IndexPath, T_BitmapHeapPath, + T_BitmapAndPath, + T_BitmapOrPath, T_NestPath, T_MergePath, T_HashPath, diff --git a/src/include/nodes/relation.h b/src/include/nodes/relation.h index 4ae0ae3a2c0..53cd96b6b28 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.106 2005/04/21 02:28:02 tgl Exp $ + * $PostgreSQL: pgsql/src/include/nodes/relation.h,v 1.107 2005/04/21 19:18:13 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -406,7 +406,7 @@ typedef struct IndexPath * 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. + * logic on top of them is represented by BitmapAndPath and BitmapOrPath. * Notice that we can use the same IndexPath node both to represent a regular * IndexScan plan, and as the child of a BitmapHeapPath that represents * scanning the same index using a BitmapIndexScan. The startup_cost and @@ -420,12 +420,38 @@ typedef struct IndexPath typedef struct BitmapHeapPath { Path path; - Node *bitmapqual; /* the IndexPath/AND/OR tree */ + Path *bitmapqual; /* IndexPath, BitmapAndPath, BitmapOrPath */ bool isjoininner; /* T if it's a nestloop inner scan */ double rows; /* estimated number of result tuples */ } BitmapHeapPath; /* + * BitmapAndPath represents a BitmapAnd plan node; it can only appear as + * part of the substructure of a BitmapHeapPath. The Path structure is + * a bit more heavyweight than we really need for this, but for simplicity + * we make it a derivative of Path anyway. + */ +typedef struct BitmapAndPath +{ + Path path; + List *bitmapquals; /* IndexPaths and BitmapOrPaths */ + Selectivity bitmapselectivity; +} BitmapAndPath; + +/* + * BitmapOrPath represents a BitmapOr plan node; it can only appear as + * part of the substructure of a BitmapHeapPath. The Path structure is + * a bit more heavyweight than we really need for this, but for simplicity + * we make it a derivative of Path anyway. + */ +typedef struct BitmapOrPath +{ + Path path; + List *bitmapquals; /* IndexPaths and BitmapAndPaths */ + Selectivity bitmapselectivity; +} BitmapOrPath; + +/* * TidPath represents a scan by TID * * tideval is an implicitly OR'ed list of quals of the form CTID = something. diff --git a/src/include/optimizer/cost.h b/src/include/optimizer/cost.h index 1f7ea96ee04..b55c2366cf9 100644 --- a/src/include/optimizer/cost.h +++ b/src/include/optimizer/cost.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/optimizer/cost.h,v 1.65 2005/04/21 02:28:02 tgl Exp $ + * $PostgreSQL: pgsql/src/include/optimizer/cost.h,v 1.66 2005/04/21 19:18:13 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -42,6 +42,7 @@ extern double cpu_operator_cost; extern Cost disable_cost; extern bool enable_seqscan; extern bool enable_indexscan; +extern bool enable_bitmapscan; extern bool enable_tidscan; extern bool enable_sort; extern bool enable_hashagg; @@ -53,8 +54,10 @@ extern double clamp_row_est(double nrows); extern void cost_seqscan(Path *path, Query *root, RelOptInfo *baserel); extern void cost_index(IndexPath *path, Query *root, IndexOptInfo *index, List *indexQuals, bool is_injoin); -extern void cost_bitmap_scan(Path *path, Query *root, RelOptInfo *baserel, - Node *bitmapqual, bool is_injoin); +extern void cost_bitmap_heap_scan(Path *path, Query *root, RelOptInfo *baserel, + Path *bitmapqual, bool is_injoin); +extern void cost_bitmap_and_node(BitmapAndPath *path, Query *root); +extern void cost_bitmap_or_node(BitmapOrPath *path, Query *root); extern void cost_tidscan(Path *path, Query *root, RelOptInfo *baserel, List *tideval); extern void cost_subqueryscan(Path *path, RelOptInfo *baserel); diff --git a/src/include/optimizer/pathnode.h b/src/include/optimizer/pathnode.h index 308c5daa6cd..7881ed17536 100644 --- a/src/include/optimizer/pathnode.h +++ b/src/include/optimizer/pathnode.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/optimizer/pathnode.h,v 1.58 2005/04/19 22:35:18 tgl Exp $ + * $PostgreSQL: pgsql/src/include/optimizer/pathnode.h,v 1.59 2005/04/21 19:18:13 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -35,7 +35,13 @@ extern IndexPath *create_index_path(Query *root, ScanDirection indexscandir); extern BitmapHeapPath *create_bitmap_heap_path(Query *root, RelOptInfo *rel, - Node *bitmapqual); + Path *bitmapqual); +extern BitmapAndPath *create_bitmap_and_path(Query *root, + RelOptInfo *rel, + List *bitmapquals); +extern BitmapOrPath *create_bitmap_or_path(Query *root, + RelOptInfo *rel, + List *bitmapquals); extern TidPath *create_tidscan_path(Query *root, RelOptInfo *rel, List *tideval); extern AppendPath *create_append_path(RelOptInfo *rel, List *subpaths); |