summaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
Diffstat (limited to 'src/include')
-rw-r--r--src/include/nodes/relation.h19
-rw-r--r--src/include/optimizer/cost.h3
-rw-r--r--src/include/optimizer/pathnode.h10
-rw-r--r--src/include/optimizer/paths.h6
-rw-r--r--src/include/optimizer/restrictinfo.h6
5 files changed, 21 insertions, 23 deletions
diff --git a/src/include/nodes/relation.h b/src/include/nodes/relation.h
index 53cd96b6b2..945858e8a6 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.107 2005/04/21 19:18:13 tgl Exp $
+ * $PostgreSQL: pgsql/src/include/nodes/relation.h,v 1.108 2005/04/22 21:58:32 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -274,10 +274,6 @@ typedef struct IndexOptInfo
bool predOK; /* true if predicate matches query */
bool unique; /* true if a unique index */
-
- /* cached info about inner indexscan paths for index */
- Relids outer_relids; /* other relids in usable join clauses */
- List *inner_paths; /* List of InnerIndexscanInfo nodes */
} IndexOptInfo;
@@ -764,16 +760,13 @@ typedef struct JoinInfo
* thus varies depending on which outer relation we consider; so we have
* to recompute the best such path for every join. To avoid lots of
* redundant computation, we cache the results of such searches. For
- * each index we compute the set of possible otherrelids (all relids
- * appearing in joinquals that could become indexquals for this index).
+ * each relation we compute the set of possible otherrelids (all relids
+ * appearing in joinquals that could become indexquals for this table).
* Two outer relations whose relids have the same intersection with this
* set will have the same set of available joinclauses and thus the same
- * best inner indexscan for that index. Similarly, for each base relation,
- * we form the union of the per-index otherrelids sets. Two outer relations
- * with the same intersection with that set will have the same best overall
- * inner indexscan for the base relation. We use lists of InnerIndexscanInfo
- * nodes to cache the results of these searches at both the index and
- * relation level.
+ * best inner indexscan for the inner relation. By taking the intersection
+ * before scanning the cache, we avoid recomputing when considering
+ * join rels that differ only by the inclusion of irrelevant other rels.
*
* The search key also includes a bool showing whether the join being
* considered is an outer join. Since we constrain the join order for
diff --git a/src/include/optimizer/cost.h b/src/include/optimizer/cost.h
index b55c2366cf..0f9e56880d 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.66 2005/04/21 19:18:13 tgl Exp $
+ * $PostgreSQL: pgsql/src/include/optimizer/cost.h,v 1.67 2005/04/22 21:58:32 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -58,6 +58,7 @@ 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_bitmap_tree_node(Path *path, Cost *cost, Selectivity *selec);
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 7881ed1753..f5c11ff58e 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.59 2005/04/21 19:18:13 tgl Exp $
+ * $PostgreSQL: pgsql/src/include/optimizer/pathnode.h,v 1.60 2005/04/22 21:58:32 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -30,12 +30,14 @@ extern void add_path(RelOptInfo *parent_rel, Path *new_path);
extern Path *create_seqscan_path(Query *root, RelOptInfo *rel);
extern IndexPath *create_index_path(Query *root,
IndexOptInfo *index,
- List *restriction_clauses,
+ List *clause_groups,
List *pathkeys,
- ScanDirection indexscandir);
+ ScanDirection indexscandir,
+ bool isjoininner);
extern BitmapHeapPath *create_bitmap_heap_path(Query *root,
RelOptInfo *rel,
- Path *bitmapqual);
+ Path *bitmapqual,
+ bool isjoininner);
extern BitmapAndPath *create_bitmap_and_path(Query *root,
RelOptInfo *rel,
List *bitmapquals);
diff --git a/src/include/optimizer/paths.h b/src/include/optimizer/paths.h
index e5ca24807d..a91744fd5f 100644
--- a/src/include/optimizer/paths.h
+++ b/src/include/optimizer/paths.h
@@ -8,7 +8,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/paths.h,v 1.81 2005/04/11 23:06:56 tgl Exp $
+ * $PostgreSQL: pgsql/src/include/optimizer/paths.h,v 1.82 2005/04/22 21:58:32 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -38,7 +38,9 @@ extern void debug_print_rel(Query *root, RelOptInfo *rel);
extern void create_index_paths(Query *root, RelOptInfo *rel);
extern Path *best_inner_indexscan(Query *root, RelOptInfo *rel,
Relids outer_relids, JoinType jointype);
-extern List *group_clauses_by_indexkey(IndexOptInfo *index);
+extern List *group_clauses_by_indexkey(IndexOptInfo *index,
+ List *clauses, List *outer_clauses,
+ Relids outer_relids);
extern List *group_clauses_by_indexkey_for_or(IndexOptInfo *index,
Expr *orsubclause);
extern bool match_index_to_operand(Node *operand, int indexcol,
diff --git a/src/include/optimizer/restrictinfo.h b/src/include/optimizer/restrictinfo.h
index a9e3bcac25..77c03bb4ec 100644
--- a/src/include/optimizer/restrictinfo.h
+++ b/src/include/optimizer/restrictinfo.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/restrictinfo.h,v 1.26 2004/12/31 22:03:36 pgsql Exp $
+ * $PostgreSQL: pgsql/src/include/optimizer/restrictinfo.h,v 1.27 2005/04/22 21:58:32 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -27,10 +27,10 @@ extern void get_actual_join_clauses(List *restrictinfo_list,
List **joinquals, List **otherquals);
extern List *remove_redundant_join_clauses(Query *root,
List *restrictinfo_list,
- JoinType jointype);
+ bool isouterjoin);
extern List *select_nonredundant_join_clauses(Query *root,
List *restrictinfo_list,
List *reference_list,
- JoinType jointype);
+ bool isouterjoin);
#endif /* RESTRICTINFO_H */