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

Rename Path.keys to Path.pathkeys. Too many 'keys' used for other things.

This commit is contained in:
Bruce Momjian
1999-02-10 03:52:54 +00:00
parent 318e593f03
commit f859c81c18
22 changed files with 131 additions and 129 deletions

View File

@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/allpaths.c,v 1.25 1999/02/03 20:15:28 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/allpaths.c,v 1.26 1999/02/10 03:52:38 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -383,8 +383,8 @@ print_path(Query *root, Path *path, int indent)
List *k,
*l;
printf(" keys=");
foreach(k, path->keys)
printf(" pathkeys=");
foreach(k, path->pathkeys)
{
printf("(");
foreach(l, lfirst(k))

View File

@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/costsize.c,v 1.27 1999/02/09 17:02:52 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/costsize.c,v 1.28 1999/02/10 03:52:39 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -164,7 +164,7 @@ cost_index(Oid indexid,
* 2. the cost of reading the sort result into memory (another seqscan)
* unless 'noread' is set
*
* 'keys' is a list of sort keys
* 'pathkeys' is a list of sort keys
* 'tuples' is the number of tuples in the relation
* 'width' is the average tuple width in bytes
* 'noread' is a flag indicating that the sort result can remain on disk
@@ -174,7 +174,7 @@ cost_index(Oid indexid,
*
*/
Cost
cost_sort(List *keys, int tuples, int width, bool noread)
cost_sort(List *pathkeys, int tuples, int width, bool noread)
{
Cost temp = 0;
int npages = page_size(tuples, width);
@@ -183,7 +183,7 @@ cost_sort(List *keys, int tuples, int width, bool noread)
if (!_enable_sort_)
temp += _disable_cost_;
if (tuples == 0 || keys == NULL)
if (tuples == 0 || pathkeys == NULL)
{
Assert(temp >= 0);
return temp;
@@ -194,8 +194,8 @@ cost_sort(List *keys, int tuples, int width, bool noread)
* could be base_log(pages, NBuffers), but we are only doing 2-way
* merges
*/
temp += _cpu_page_wight_ *
numTuples * base_log((double) pages, (double) 2.0);
temp += _cpu_page_wight_ * numTuples *
base_log((double) pages, (double) 2.0);
if (!noread)
temp = temp + cost_seqscan(_NONAME_RELATION_ID_, npages, tuples);

View File

@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/Attic/hashutils.c,v 1.11 1999/02/04 03:19:08 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/Attic/hashutils.c,v 1.12 1999/02/10 03:52:39 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -58,21 +58,21 @@ group_clauses_by_hashop(List *restrictinfo_list,
Expr *clause = restrictinfo->clause;
Var *leftop = get_leftop(clause);
Var *rightop = get_rightop(clause);
JoinKey *keys = (JoinKey *) NULL;
JoinKey *joinkey = (JoinKey *) NULL;
xhashinfo = match_hashop_hashinfo(hashjoinop, hashinfo_list);
if (inner_relid == leftop->varno)
{
keys = makeNode(JoinKey);
keys->outer = rightop;
keys->inner = leftop;
joinkey = makeNode(JoinKey);
joinkey->outer = rightop;
joinkey->inner = leftop;
}
else
{
keys = makeNode(JoinKey);
keys->outer = leftop;
keys->inner = rightop;
joinkey = makeNode(JoinKey);
joinkey->outer = leftop;
joinkey->inner = rightop;
}
if (xhashinfo == NULL)
@@ -90,7 +90,7 @@ group_clauses_by_hashop(List *restrictinfo_list,
xhashinfo->jmethod.clauses = lcons(clause, xhashinfo->jmethod.clauses);
xhashinfo->jmethod.jmkeys = lcons(keys, xhashinfo->jmethod.jmkeys);
xhashinfo->jmethod.jmkeys = lcons(joinkey, xhashinfo->jmethod.jmkeys);
}
}
return hashinfo_list;

View File

@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/indxpath.c,v 1.40 1999/02/09 03:51:17 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/indxpath.c,v 1.41 1999/02/10 03:52:39 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -144,7 +144,7 @@ find_index_paths(Query *root,
* restriction clauses, then create pathnodes corresponding to
* each group of usable clauses.
*/
scanclausegroups = group_clauses_by_indexkey(rel,
scanclausegroups = group_clauses_by_indexkey(rel,
index,
index->indexkeys,
index->classlist,
@@ -1293,7 +1293,7 @@ index_innerjoin(Query *root, RelOptInfo * rel, List *clausegroup_list,
pathnode->path.path_order = makeNode(PathOrder);
pathnode->path.path_order->ordtype = SORTOP_ORDER;
pathnode->path.path_order->ord.sortop = index->ordering;
pathnode->path.keys = NIL; /* not sure about this, bjm 1998/09/21 */
pathnode->path.pathkeys = NIL;
pathnode->indexid = index->relids;
pathnode->indexkeys = index->indexkeys;

View File

@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/joinpath.c,v 1.16 1999/02/09 03:51:19 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/joinpath.c,v 1.17 1999/02/10 03:52:40 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -341,19 +341,19 @@ match_unsorted_outer(RelOptInfo * joinrel,
if (clauses)
{
List *keys = xmergeinfo->jmethod.jmkeys;
List *jmkeys = xmergeinfo->jmethod.jmkeys;
List *clauses = xmergeinfo->jmethod.clauses;
matchedJoinKeys = match_pathkeys_joinkeys(outerpath->keys,
keys,
matchedJoinKeys = match_pathkeys_joinkeys(outerpath->pathkeys,
jmkeys,
clauses,
OUTER,
&matchedJoinClauses);
merge_pathkeys = new_join_pathkeys(outerpath->keys,
merge_pathkeys = new_join_pathkeys(outerpath->pathkeys,
joinrel->targetlist, clauses);
}
else
merge_pathkeys = outerpath->keys;
merge_pathkeys = outerpath->pathkeys;
if (best_innerjoin &&
path_is_cheaper(best_innerjoin, cheapest_inner))
@@ -415,7 +415,7 @@ match_unsorted_outer(RelOptInfo * joinrel,
matchedJoinClauses,
NIL,
varkeys),
paths);
paths);
}
else
temp_node = paths;
@@ -484,11 +484,11 @@ match_unsorted_inner(RelOptInfo * joinrel,
if (clauses)
{
List *keys = xmergeinfo->jmethod.jmkeys;
List *jmkeys = xmergeinfo->jmethod.jmkeys;
List *cls = xmergeinfo->jmethod.clauses;
matchedJoinKeys = match_pathkeys_joinkeys(innerpath->keys,
keys,
matchedJoinKeys = match_pathkeys_joinkeys(innerpath->pathkeys,
jmkeys,
cls,
INNER,
&matchedJoinClauses);

View File

@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/Attic/joinutils.c,v 1.13 1999/02/09 17:02:55 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/Attic/joinutils.c,v 1.14 1999/02/10 03:52:40 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -44,7 +44,7 @@ static List *new_matching_subkeys(Var *subkey, List *considered_subkeys,
* match-pathkeys-joinkeys--
* Attempts to match the keys of a path against the keys of join clauses.
* This is done by looking for a matching join key in 'joinkeys' for
* every path key in the list 'pathkeys'. If there is a matching join key
* every path key in the list 'path.keys'. If there is a matching join key
* (not necessarily unique) for every path key, then the list of
* corresponding join keys and join clauses are returned in the order in
* which the keys matched the path keys.
@@ -216,10 +216,10 @@ match_paths_joinkeys(List *joinkeys,
{
Path *path = (Path *) lfirst(i);
key_match = every_func(joinkeys, path->keys, which_subkey);
key_match = every_func(joinkeys, path->pathkeys, which_subkey);
if (equal_path_ordering(ordering, path->path_order) &&
length(joinkeys) == length(path->keys) &&
length(joinkeys) == length(path->pathkeys) &&
key_match)
{
@@ -249,7 +249,7 @@ match_paths_joinkeys(List *joinkeys,
* in 'joinkeys'
*
* Returns a list of pathkeys: ((tlvar1)(tlvar2)...(tlvarN)).
* [I've no idea why they have to be list of lists. Should be fixed. -ay 12/94]
* It is a list of lists because of multi-key indexes.
*/
List *
extract_path_keys(List *joinkeys,

View File

@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/Attic/mergeutils.c,v 1.15 1999/02/09 03:51:20 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/Attic/mergeutils.c,v 1.16 1999/02/10 03:52:41 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -57,7 +57,7 @@ group_clauses_by_order(List *restrictinfo_list,
Expr *clause = restrictinfo->clause;
Var *leftop = get_leftop(clause);
Var *rightop = get_rightop(clause);
JoinKey *keys;
JoinKey *jmkeys;
path_order = makeNode(PathOrder);
path_order->ordtype = MERGE_ORDER;
@@ -65,15 +65,15 @@ group_clauses_by_order(List *restrictinfo_list,
xmergeinfo = match_order_mergeinfo(path_order, mergeinfo_list);
if (inner_relid == leftop->varno)
{
keys = makeNode(JoinKey);
keys->outer = rightop;
keys->inner = leftop;
jmkeys = makeNode(JoinKey);
jmkeys->outer = rightop;
jmkeys->inner = leftop;
}
else
{
keys = makeNode(JoinKey);
keys->outer = leftop;
keys->inner = rightop;
jmkeys = makeNode(JoinKey);
jmkeys->outer = leftop;
jmkeys->inner = rightop;
}
if (xmergeinfo == NULL)
@@ -87,7 +87,7 @@ group_clauses_by_order(List *restrictinfo_list,
((JoinMethod *) xmergeinfo)->clauses = lcons(clause,
((JoinMethod *) xmergeinfo)->clauses);
((JoinMethod *) xmergeinfo)->jmkeys = lcons(keys,
((JoinMethod *) xmergeinfo)->jmkeys = lcons(jmkeys,
((JoinMethod *) xmergeinfo)->jmkeys);
}
}

View File

@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/orindxpath.c,v 1.16 1999/02/09 03:51:20 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/orindxpath.c,v 1.17 1999/02/10 03:52:41 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -112,7 +112,7 @@ create_or_index_paths(Query *root,
* not in any order, so the sortop is NULL.
*/
pathnode->path.path_order->ord.sortop = NULL;
pathnode->path.keys = NIL; /* not sure about this, bjm 1998/09/21 */
pathnode->path.pathkeys = NIL;
pathnode->indexqual = lcons(clausenode, NIL);
pathnode->indexid = indexids;