mirror of
https://github.com/postgres/postgres.git
synced 2025-11-15 03:41:20 +03:00
Rename same() to sameseti() to have a slightly less generic name. Move
nonoverlap_sets() and is_subset() to list.c, where they should have lived to begin with, and rename to nonoverlap_setsi and is_subseti since they only work on integer lists.
This commit is contained in:
@@ -8,7 +8,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/joinpath.c,v 1.49 2000/01/26 05:56:34 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/joinpath.c,v 1.50 2000/02/06 03:27:32 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -181,7 +181,7 @@ best_innerjoin(List *join_paths, Relids outer_relids)
|
||||
* outer_relids in order to use this inner path, because those
|
||||
* rels are used in the index join quals of this inner path.
|
||||
*/
|
||||
if (is_subset(((IndexPath *) path)->joinrelids, outer_relids) &&
|
||||
if (is_subseti(((IndexPath *) path)->joinrelids, outer_relids) &&
|
||||
(cheapest == NULL ||
|
||||
path_is_cheaper(path, cheapest)))
|
||||
cheapest = path;
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/joinrels.c,v 1.41 2000/01/26 05:56:34 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/joinrels.c,v 1.42 2000/02/06 03:27:32 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -144,8 +144,8 @@ make_rels_by_clause_joins(Query *root, RelOptInfo *old_rel,
|
||||
RelOptInfo *join_rel = lfirst(r);
|
||||
|
||||
Assert(length(join_rel->relids) > 1);
|
||||
if (is_subset(unjoined_relids, join_rel->relids) &&
|
||||
nonoverlap_sets(old_rel->relids, join_rel->relids))
|
||||
if (is_subseti(unjoined_relids, join_rel->relids) &&
|
||||
nonoverlap_setsi(old_rel->relids, join_rel->relids))
|
||||
{
|
||||
joined_rel = make_join_rel(old_rel, join_rel);
|
||||
join_list = lappend(join_list, joined_rel);
|
||||
@@ -175,7 +175,7 @@ make_rels_by_clauseless_joins(RelOptInfo *old_rel, List *inner_rels)
|
||||
{
|
||||
RelOptInfo *inner_rel = (RelOptInfo *) lfirst(i);
|
||||
|
||||
if (nonoverlap_sets(inner_rel->relids, old_rel->relids))
|
||||
if (nonoverlap_setsi(inner_rel->relids, old_rel->relids))
|
||||
{
|
||||
join_list = lappend(join_list,
|
||||
make_join_rel(old_rel, inner_rel));
|
||||
@@ -404,39 +404,3 @@ get_cheapest_complete_rel(List *join_rel_list)
|
||||
|
||||
return final_rel;
|
||||
}
|
||||
|
||||
/*
|
||||
* Subset-inclusion tests on integer lists.
|
||||
*
|
||||
* XXX these probably ought to be in nodes/list.c or some such place.
|
||||
*/
|
||||
|
||||
bool
|
||||
nonoverlap_sets(List *s1, List *s2)
|
||||
{
|
||||
List *x;
|
||||
|
||||
foreach(x, s1)
|
||||
{
|
||||
int e = lfirsti(x);
|
||||
|
||||
if (intMember(e, s2))
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool
|
||||
is_subset(List *s1, List *s2)
|
||||
{
|
||||
List *x;
|
||||
|
||||
foreach(x, s1)
|
||||
{
|
||||
int e = lfirsti(x);
|
||||
|
||||
if (!intMember(e, s2))
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/Attic/prune.c,v 1.45 2000/01/26 05:56:34 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/Attic/prune.c,v 1.46 2000/02/06 03:27:32 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -67,7 +67,7 @@ merge_rel_with_same_relids(RelOptInfo *rel, List *unmerged_rels)
|
||||
{
|
||||
RelOptInfo *unmerged_rel = (RelOptInfo *) lfirst(i);
|
||||
|
||||
if (same(rel->relids, unmerged_rel->relids))
|
||||
if (sameseti(rel->relids, unmerged_rel->relids))
|
||||
{
|
||||
/*
|
||||
* These rels are for the same set of base relations,
|
||||
|
||||
Reference in New Issue
Block a user