1
0
mirror of https://github.com/postgres/postgres.git synced 2025-11-15 03:41:20 +03:00

More optimizer speedups.

This commit is contained in:
Bruce Momjian
1999-02-11 14:59:09 +00:00
parent 129543e22d
commit d244df95db
17 changed files with 192 additions and 131 deletions

View File

@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/indxpath.c,v 1.42 1999/02/10 21:02:38 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/indxpath.c,v 1.43 1999/02/11 14:58:50 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -1290,9 +1290,9 @@ index_innerjoin(Query *root, RelOptInfo *rel, List *clausegroup_list,
pathnode->path.pathtype = T_IndexScan;
pathnode->path.parent = rel;
pathnode->path.path_order = makeNode(PathOrder);
pathnode->path.path_order->ordtype = SORTOP_ORDER;
pathnode->path.path_order->ord.sortop = index->ordering;
pathnode->path.pathorder = makeNode(PathOrder);
pathnode->path.pathorder->ordtype = SORTOP_ORDER;
pathnode->path.pathorder->ord.sortop = index->ordering;
pathnode->path.pathkeys = NIL;
pathnode->indexid = index->relids;

View File

@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/joinpath.c,v 1.19 1999/02/10 21:02:38 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/joinpath.c,v 1.20 1999/02/11 14:58:52 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -327,7 +327,7 @@ match_unsorted_outer(RelOptInfo *joinrel,
outerpath = (Path *) lfirst(i);
outerpath_ordering = outerpath->path_order;
outerpath_ordering = outerpath->pathorder;
if (outerpath_ordering)
{
@@ -470,7 +470,7 @@ match_unsorted_inner(RelOptInfo *joinrel,
innerpath = (Path *) lfirst(i);
innerpath_ordering = innerpath->path_order;
innerpath_ordering = innerpath->pathorder;
if (innerpath_ordering)
{

View File

@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/Attic/joinutils.c,v 1.17 1999/02/11 05:29:07 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/Attic/joinutils.c,v 1.18 1999/02/11 14:58:53 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -214,10 +214,12 @@ match_paths_joinkeys(List *joinkeys,
foreach(i, paths)
{
Path *path = (Path *) lfirst(i);
int more_sort;
key_match = every_func(joinkeys, path->pathkeys, which_subkey);
if (equal_path_ordering(ordering, path->path_order) &&
if (pathorder_match(ordering, path->pathorder, &more_sort) &&
more_sort == 0 &&
length(joinkeys) == length(path->pathkeys) && key_match)
{

View File

@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/Attic/mergeutils.c,v 1.16 1999/02/10 03:52:41 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/Attic/mergeutils.c,v 1.17 1999/02/11 14:58:53 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -52,17 +52,17 @@ group_clauses_by_order(List *restrictinfo_list,
* Create a new mergeinfo node and add it to 'mergeinfo-list'
* if one does not yet exist for this merge ordering.
*/
PathOrder *path_order;
PathOrder *pathorder;
MergeInfo *xmergeinfo;
Expr *clause = restrictinfo->clause;
Var *leftop = get_leftop(clause);
Var *rightop = get_rightop(clause);
JoinKey *jmkeys;
path_order = makeNode(PathOrder);
path_order->ordtype = MERGE_ORDER;
path_order->ord.merge = merge_ordering;
xmergeinfo = match_order_mergeinfo(path_order, mergeinfo_list);
pathorder = makeNode(PathOrder);
pathorder->ordtype = MERGE_ORDER;
pathorder->ord.merge = merge_ordering;
xmergeinfo = match_order_mergeinfo(pathorder, mergeinfo_list);
if (inner_relid == leftop->varno)
{
jmkeys = makeNode(JoinKey);

View File

@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/orindxpath.c,v 1.18 1999/02/10 21:02:39 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/orindxpath.c,v 1.19 1999/02/11 14:58:53 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -104,14 +104,14 @@ create_or_index_paths(Query *root,
pathnode->path.pathtype = T_IndexScan;
pathnode->path.parent = rel;
pathnode->path.path_order = makeNode(PathOrder);
pathnode->path.path_order->ordtype = SORTOP_ORDER;
pathnode->path.pathorder = makeNode(PathOrder);
pathnode->path.pathorder->ordtype = SORTOP_ORDER;
/*
* This is an IndexScan, but it does index lookups based
* on the order of the fields specified in the WHERE clause,
* not in any order, so the sortop is NULL.
*/
pathnode->path.path_order->ord.sortop = NULL;
pathnode->path.pathorder->ord.sortop = NULL;
pathnode->path.pathkeys = NIL;
pathnode->indexqual = lcons(clausenode, NIL);

View File

@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/Attic/prune.c,v 1.26 1999/02/10 21:02:40 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/Attic/prune.c,v 1.27 1999/02/11 14:58:54 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -109,7 +109,7 @@ prune_rel_paths(List *rel_list)
{
path = (Path *) lfirst(y);
if (!path->path_order->ord.sortop)
if (!path->pathorder->ord.sortop)
break;
}
cheapest = (JoinPath *) prune_rel_path(rel, path);