Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
d8b482be
Commit
d8b482be
authored
Feb 14, 1999
by
Bruce Momjian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
optimizer cleanup.
parent
808a6df0
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
43 deletions
+15
-43
src/backend/optimizer/path/allpaths.c
src/backend/optimizer/path/allpaths.c
+14
-14
src/backend/optimizer/path/joinpath.c
src/backend/optimizer/path/joinpath.c
+1
-29
No files found.
src/backend/optimizer/path/allpaths.c
View file @
d8b482be
...
...
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/allpaths.c,v 1.3
3 1999/02/14 05:14:08
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/allpaths.c,v 1.3
4 1999/02/14 05:27:11
momjian Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -162,7 +162,7 @@ static List *
find_join_paths
(
Query
*
root
,
List
*
outer_rels
,
int
levels_needed
)
{
List
*
x
;
List
*
new
_rels
=
NIL
;
List
*
joined
_rels
=
NIL
;
RelOptInfo
*
rel
;
/*******************************************
...
...
@@ -181,14 +181,14 @@ find_join_paths(Query *root, List *outer_rels, int levels_needed)
/*
* Determine all possible pairs of relations to be joined at this
* level. Determine paths for joining these relation pairs and
* modify '
new
_rels' accordingly, then eliminate redundant join
* modify '
joined
_rels' accordingly, then eliminate redundant join
* relations.
*/
new
_rels
=
make_new_rels_by_joins
(
root
,
outer_rels
);
joined
_rels
=
make_new_rels_by_joins
(
root
,
outer_rels
);
update_rels_pathlist_for_joins
(
root
,
new
_rels
);
update_rels_pathlist_for_joins
(
root
,
joined
_rels
);
merge_rels_with_same_relids
(
new
_rels
);
merge_rels_with_same_relids
(
joined
_rels
);
#if 0
/*
...
...
@@ -196,11 +196,11 @@ find_join_paths(Query *root, List *outer_rels, int levels_needed)
* rel, * consider doing pullup -- JMH
*/
if (XfuncMode != XFUNC_NOPULL && XfuncMode != XFUNC_OFF)
foreach(x,
new
_rels)
foreach(x,
joined
_rels)
xfunc_trypullup((RelOptInfo *) lfirst(x));
#endif
rels_set_cheapest
(
new
_rels
);
rels_set_cheapest
(
joined
_rels
);
if
(
BushyPlanFlag
)
{
...
...
@@ -211,10 +211,10 @@ find_join_paths(Query *root, List *outer_rels, int levels_needed)
* involves the join relation to the joininfo list of the
* other relation
*/
add_new_joininfos
(
root
,
new
_rels
,
outer_rels
);
add_new_joininfos
(
root
,
joined
_rels
,
outer_rels
);
}
foreach
(
x
,
new
_rels
)
foreach
(
x
,
joined
_rels
)
{
rel
=
(
RelOptInfo
*
)
lfirst
(
x
);
...
...
@@ -239,20 +239,20 @@ find_join_paths(Query *root, List *outer_rels, int levels_needed)
/*
* merge join rels if then contain the same list of base rels
*/
outer_rels
=
merge_joinrels
(
new
_rels
,
outer_rels
);
outer_rels
=
merge_joinrels
(
joined
_rels
,
outer_rels
);
root
->
join_rel_list
=
outer_rels
;
}
else
root
->
join_rel_list
=
new
_rels
;
root
->
join_rel_list
=
joined
_rels
;
if
(
!
BushyPlanFlag
)
outer_rels
=
new
_rels
;
outer_rels
=
joined
_rels
;
}
if
(
BushyPlanFlag
)
return
final_join_rels
(
outer_rels
);
else
return
new
_rels
;
return
joined
_rels
;
}
/*****************************************************************************
...
...
src/backend/optimizer/path/joinpath.c
View file @
d8b482be
...
...
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/joinpath.c,v 1.2
4 1999/02/14 04:56:46
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/joinpath.c,v 1.2
5 1999/02/14 05:27:12
momjian Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -66,8 +66,6 @@ update_rels_pathlist_for_joins(Query *root, List *joinrels)
{
List
*
mergeinfo_list
=
NIL
;
List
*
hashinfo_list
=
NIL
;
List
*
temp_list
=
NIL
;
List
*
path
=
NIL
;
List
*
j
;
foreach
(
j
,
joinrels
)
...
...
@@ -144,37 +142,11 @@ update_rels_pathlist_for_joins(Query *root, List *joinrels)
* 4. Consider paths where both outer and inner relations must be
* hashed before being joined.
*/
pathlist
=
add_pathlist
(
joinrel
,
pathlist
,
hash_inner_and_outer
(
joinrel
,
outerrel
,
innerrel
,
hashinfo_list
));
joinrel
->
pathlist
=
pathlist
;
/*
* 'OuterJoinCost is only valid when calling
* (match_unsorted_inner) with the same arguments as the previous
* invokation of (match_unsorted_outer), so clear the field before
* going on.
*/
temp_list
=
innerrel
->
pathlist
;
foreach
(
path
,
temp_list
)
{
/*
* XXX
*
* This gross hack is to get around an apparent optimizer bug on
* Sparc (or maybe it is a bug of ours?) that causes really
* wierd behavior.
*/
if
(
IsA_JoinPath
(
path
))
((
Path
*
)
lfirst
(
path
))
->
outerjoincost
=
(
Cost
)
0
;
/*
* do it iff it is a join path, which is not always true, esp
* since the base level
*/
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment