mirror of
https://github.com/postgres/postgres.git
synced 2025-07-03 20:02:46 +03:00
Optimizer cleanup.
This commit is contained in:
@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/optimizer/util/pathnode.c,v 1.19 1999/02/06 17:29:27 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/optimizer/util/pathnode.c,v 1.20 1999/02/08 04:29:21 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -165,8 +165,8 @@ better_path(Path *new_path, List *unique_paths, bool *noOther)
|
||||
path = (Path *) lfirst(temp);
|
||||
|
||||
if (samekeys(path->keys, new_path->keys) &&
|
||||
equal_path_ordering(&path->p_ordering,
|
||||
&new_path->p_ordering))
|
||||
equal_path_ordering(&path->path_order,
|
||||
&new_path->path_order))
|
||||
{
|
||||
old_path = path;
|
||||
break;
|
||||
@ -207,8 +207,8 @@ create_seqscan_path(RelOptInfo * rel)
|
||||
pathnode->pathtype = T_SeqScan;
|
||||
pathnode->parent = rel;
|
||||
pathnode->path_cost = 0.0;
|
||||
pathnode->p_ordering.ordtype = SORTOP_ORDER;
|
||||
pathnode->p_ordering.ord.sortop = NULL;
|
||||
pathnode->path_order.ordtype = SORTOP_ORDER;
|
||||
pathnode->path_order.ord.sortop = NULL;
|
||||
pathnode->keys = NIL;
|
||||
|
||||
/*
|
||||
@ -256,8 +256,8 @@ create_index_path(Query *root,
|
||||
|
||||
pathnode->path.pathtype = T_IndexScan;
|
||||
pathnode->path.parent = rel;
|
||||
pathnode->path.p_ordering.ordtype = SORTOP_ORDER;
|
||||
pathnode->path.p_ordering.ord.sortop = index->ordering;
|
||||
pathnode->path.path_order.ordtype = SORTOP_ORDER;
|
||||
pathnode->path.path_order.ord.sortop = index->ordering;
|
||||
|
||||
pathnode->indexid = index->relids;
|
||||
pathnode->indexkeys = index->indexkeys;
|
||||
@ -274,7 +274,7 @@ create_index_path(Query *root,
|
||||
* The index must have an ordering for the path to have (ordering)
|
||||
* keys, and vice versa.
|
||||
*/
|
||||
if (pathnode->path.p_ordering.ord.sortop)
|
||||
if (pathnode->path.path_order.ord.sortop)
|
||||
{
|
||||
pathnode->path.keys = collect_index_pathkeys(index->indexkeys,
|
||||
rel->targetlist);
|
||||
@ -286,7 +286,7 @@ create_index_path(Query *root,
|
||||
* if no index keys were found, we can't order the path).
|
||||
*/
|
||||
if (pathnode->path.keys == NULL)
|
||||
pathnode->path.p_ordering.ord.sortop = NULL;
|
||||
pathnode->path.path_order.ord.sortop = NULL;
|
||||
}
|
||||
else
|
||||
pathnode->path.keys = NULL;
|
||||
@ -415,20 +415,20 @@ create_nestloop_path(RelOptInfo * joinrel,
|
||||
|
||||
if (keys)
|
||||
{
|
||||
pathnode->path.p_ordering.ordtype = outer_path->p_ordering.ordtype;
|
||||
if (outer_path->p_ordering.ordtype == SORTOP_ORDER)
|
||||
pathnode->path.path_order.ordtype = outer_path->path_order.ordtype;
|
||||
if (outer_path->path_order.ordtype == SORTOP_ORDER)
|
||||
{
|
||||
pathnode->path.p_ordering.ord.sortop = outer_path->p_ordering.ord.sortop;
|
||||
pathnode->path.path_order.ord.sortop = outer_path->path_order.ord.sortop;
|
||||
}
|
||||
else
|
||||
{
|
||||
pathnode->path.p_ordering.ord.merge = outer_path->p_ordering.ord.merge;
|
||||
pathnode->path.path_order.ord.merge = outer_path->path_order.ord.merge;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
pathnode->path.p_ordering.ordtype = SORTOP_ORDER;
|
||||
pathnode->path.p_ordering.ord.sortop = NULL;
|
||||
pathnode->path.path_order.ordtype = SORTOP_ORDER;
|
||||
pathnode->path.path_order.ord.sortop = NULL;
|
||||
}
|
||||
|
||||
pathnode->path.path_cost = cost_nestloop(outer_path->path_cost,
|
||||
@ -487,8 +487,8 @@ create_mergejoin_path(RelOptInfo * joinrel,
|
||||
pathnode->jpath.innerjoinpath = inner_path;
|
||||
pathnode->jpath.pathinfo = joinrel->restrictinfo;
|
||||
pathnode->jpath.path.keys = keys;
|
||||
pathnode->jpath.path.p_ordering.ordtype = MERGE_ORDER;
|
||||
pathnode->jpath.path.p_ordering.ord.merge = order;
|
||||
pathnode->jpath.path.path_order.ordtype = MERGE_ORDER;
|
||||
pathnode->jpath.path.path_order.ord.merge = order;
|
||||
pathnode->path_mergeclauses = mergeclauses;
|
||||
pathnode->jpath.path.loc_restrictinfo = NIL;
|
||||
pathnode->outersortkeys = outersortkeys;
|
||||
@ -552,8 +552,8 @@ create_hashjoin_path(RelOptInfo * joinrel,
|
||||
pathnode->jpath.pathinfo = joinrel->restrictinfo;
|
||||
pathnode->jpath.path.loc_restrictinfo = NIL;
|
||||
pathnode->jpath.path.keys = keys;
|
||||
pathnode->jpath.path.p_ordering.ordtype = SORTOP_ORDER;
|
||||
pathnode->jpath.path.p_ordering.ord.sortop = NULL;
|
||||
pathnode->jpath.path.path_order.ordtype = SORTOP_ORDER;
|
||||
pathnode->jpath.path.path_order.ord.sortop = NULL;
|
||||
pathnode->jpath.path.outerjoincost = (Cost) 0.0;
|
||||
pathnode->jpath.path.joinid = (Relid) NULL;
|
||||
/* pathnode->hashjoinoperator = operator; */
|
||||
|
Reference in New Issue
Block a user