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
ad4b27ac
Commit
ad4b27ac
authored
Feb 12, 1999
by
Bruce Momjian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Optimizer cleanup.
parent
c0d17c7a
Changes
13
Show whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
88 additions
and
84 deletions
+88
-84
src/backend/optimizer/geqo/geqo_misc.c
src/backend/optimizer/geqo/geqo_misc.c
+4
-4
src/backend/optimizer/geqo/geqo_paths.c
src/backend/optimizer/geqo/geqo_paths.c
+2
-2
src/backend/optimizer/path/allpaths.c
src/backend/optimizer/path/allpaths.c
+4
-4
src/backend/optimizer/path/costsize.c
src/backend/optimizer/path/costsize.c
+2
-2
src/backend/optimizer/path/joinpath.c
src/backend/optimizer/path/joinpath.c
+2
-1
src/backend/optimizer/path/predmig.c
src/backend/optimizer/path/predmig.c
+26
-26
src/backend/optimizer/path/prune.c
src/backend/optimizer/path/prune.c
+4
-4
src/backend/optimizer/path/xfunc.c
src/backend/optimizer/path/xfunc.c
+21
-21
src/backend/optimizer/plan/createplan.c
src/backend/optimizer/plan/createplan.c
+4
-4
src/include/executor/nodeNestloop.h
src/include/executor/nodeNestloop.h
+3
-2
src/include/nodes/relation.h
src/include/nodes/relation.h
+6
-4
src/include/optimizer/cost.h
src/include/optimizer/cost.h
+2
-2
src/include/optimizer/xfunc.h
src/include/optimizer/xfunc.h
+8
-8
No files found.
src/backend/optimizer/geqo/geqo_misc.c
View file @
ad4b27ac
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
*
*
* Copyright (c) 1994, Regents of the University of California
* Copyright (c) 1994, Regents of the University of California
*
*
* $Id: geqo_misc.c,v 1.1
5 1999/02/12 06:43:26
momjian Exp $
* $Id: geqo_misc.c,v 1.1
6 1999/02/12 17:24:47
momjian Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -158,7 +158,7 @@ void
...
@@ -158,7 +158,7 @@ void
geqo_print_path
(
Query
*
root
,
Path
*
path
,
int
indent
)
geqo_print_path
(
Query
*
root
,
Path
*
path
,
int
indent
)
{
{
char
*
ptype
=
NULL
;
char
*
ptype
=
NULL
;
Nest
Path
*
jp
;
Join
Path
*
jp
;
bool
join
=
false
;
bool
join
=
false
;
int
i
;
int
i
;
...
@@ -194,7 +194,7 @@ geqo_print_path(Query *root, Path *path, int indent)
...
@@ -194,7 +194,7 @@ geqo_print_path(Query *root, Path *path, int indent)
{
{
int
size
=
path
->
parent
->
size
;
int
size
=
path
->
parent
->
size
;
jp
=
(
Nest
Path
*
)
path
;
jp
=
(
Join
Path
*
)
path
;
printf
(
"%s size=%d cost=%f
\n
"
,
ptype
,
size
,
path
->
path_cost
);
printf
(
"%s size=%d cost=%f
\n
"
,
ptype
,
size
,
path
->
path_cost
);
switch
(
nodeTag
(
path
))
switch
(
nodeTag
(
path
))
{
{
...
@@ -203,7 +203,7 @@ geqo_print_path(Query *root, Path *path, int indent)
...
@@ -203,7 +203,7 @@ geqo_print_path(Query *root, Path *path, int indent)
for
(
i
=
0
;
i
<
indent
+
1
;
i
++
)
for
(
i
=
0
;
i
<
indent
+
1
;
i
++
)
printf
(
"
\t
"
);
printf
(
"
\t
"
);
printf
(
" clauses=("
);
printf
(
" clauses=("
);
geqo_print_joinclauses
(
root
,
((
Nest
Path
*
)
path
)
->
pathinfo
);
geqo_print_joinclauses
(
root
,
((
Join
Path
*
)
path
)
->
pathinfo
);
printf
(
")
\n
"
);
printf
(
")
\n
"
);
if
(
nodeTag
(
path
)
==
T_MergePath
)
if
(
nodeTag
(
path
)
==
T_MergePath
)
...
...
src/backend/optimizer/geqo/geqo_paths.c
View file @
ad4b27ac
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
*
*
* Copyright (c) 1994, Regents of the University of California
* Copyright (c) 1994, Regents of the University of California
*
*
* $Id: geqo_paths.c,v 1.1
8 1999/02/12 06:43:26
momjian Exp $
* $Id: geqo_paths.c,v 1.1
9 1999/02/12 17:24:47
momjian Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -98,7 +98,7 @@ geqo_prune_rel(RelOptInfo *rel, List *other_rels)
...
@@ -98,7 +98,7 @@ geqo_prune_rel(RelOptInfo *rel, List *other_rels)
void
void
geqo_set_cheapest
(
RelOptInfo
*
rel
)
geqo_set_cheapest
(
RelOptInfo
*
rel
)
{
{
NestPath
*
cheapest
=
(
Nest
Path
*
)
set_cheapest
(
rel
,
rel
->
pathlist
);
JoinPath
*
cheapest
=
(
Join
Path
*
)
set_cheapest
(
rel
,
rel
->
pathlist
);
if
(
IsA_JoinPath
(
cheapest
))
if
(
IsA_JoinPath
(
cheapest
))
rel
->
size
=
compute_joinrel_size
(
cheapest
);
rel
->
size
=
compute_joinrel_size
(
cheapest
);
...
...
src/backend/optimizer/path/allpaths.c
View file @
ad4b27ac
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/allpaths.c,v 1.
29 1999/02/12 06:43:2
8 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/allpaths.c,v 1.
30 1999/02/12 17:24:4
8 momjian Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -302,7 +302,7 @@ static void
...
@@ -302,7 +302,7 @@ static void
print_path
(
Query
*
root
,
Path
*
path
,
int
indent
)
print_path
(
Query
*
root
,
Path
*
path
,
int
indent
)
{
{
char
*
ptype
=
NULL
;
char
*
ptype
=
NULL
;
Nest
Path
*
jp
;
Join
Path
*
jp
;
bool
join
=
false
;
bool
join
=
false
;
int
i
;
int
i
;
...
@@ -338,7 +338,7 @@ print_path(Query *root, Path *path, int indent)
...
@@ -338,7 +338,7 @@ print_path(Query *root, Path *path, int indent)
{
{
int
size
=
path
->
parent
->
size
;
int
size
=
path
->
parent
->
size
;
jp
=
(
Nest
Path
*
)
path
;
jp
=
(
Join
Path
*
)
path
;
printf
(
"%s size=%d cost=%f
\n
"
,
ptype
,
size
,
path
->
path_cost
);
printf
(
"%s size=%d cost=%f
\n
"
,
ptype
,
size
,
path
->
path_cost
);
switch
(
nodeTag
(
path
))
switch
(
nodeTag
(
path
))
{
{
...
@@ -347,7 +347,7 @@ print_path(Query *root, Path *path, int indent)
...
@@ -347,7 +347,7 @@ print_path(Query *root, Path *path, int indent)
for
(
i
=
0
;
i
<
indent
+
1
;
i
++
)
for
(
i
=
0
;
i
<
indent
+
1
;
i
++
)
printf
(
"
\t
"
);
printf
(
"
\t
"
);
printf
(
" clauses=("
);
printf
(
" clauses=("
);
print_joinclauses
(
root
,
((
Nest
Path
*
)
path
)
->
pathinfo
);
print_joinclauses
(
root
,
((
Join
Path
*
)
path
)
->
pathinfo
);
printf
(
")
\n
"
);
printf
(
")
\n
"
);
if
(
nodeTag
(
path
)
==
T_MergePath
)
if
(
nodeTag
(
path
)
==
T_MergePath
)
...
...
src/backend/optimizer/path/costsize.c
View file @
ad4b27ac
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/costsize.c,v 1.3
0 1999/02/12 06:43:28
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/costsize.c,v 1.3
1 1999/02/12 17:24:49
momjian Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -435,7 +435,7 @@ compute_attribute_width(TargetEntry *tlistentry)
...
@@ -435,7 +435,7 @@ compute_attribute_width(TargetEntry *tlistentry)
* Returns a fixnum.
* Returns a fixnum.
*/
*/
int
int
compute_joinrel_size
(
Nest
Path
*
joinpath
)
compute_joinrel_size
(
Join
Path
*
joinpath
)
{
{
Cost
temp
=
1
.
0
;
Cost
temp
=
1
.
0
;
int
temp1
=
0
;
int
temp1
=
0
;
...
...
src/backend/optimizer/path/joinpath.c
View file @
ad4b27ac
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/joinpath.c,v 1.2
1 1999/02/12 06:43:30
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/joinpath.c,v 1.2
2 1999/02/12 17:24:49
momjian Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -372,6 +372,7 @@ match_unsorted_outer(RelOptInfo *joinrel,
...
@@ -372,6 +372,7 @@ match_unsorted_outer(RelOptInfo *joinrel,
innerrel
->
pathlist
,
innerrel
->
pathlist
,
INNER
);
INNER
);
/* Should we use the mergeinner, or sort the cheapest inner? */
path_is_cheaper_than_sort
=
(
bool
)
(
mergeinnerpath
&&
path_is_cheaper_than_sort
=
(
bool
)
(
mergeinnerpath
&&
(
mergeinnerpath
->
path_cost
<
(
mergeinnerpath
->
path_cost
<
(
cheapest_inner
->
path_cost
+
(
cheapest_inner
->
path_cost
+
...
...
src/backend/optimizer/path/predmig.c
View file @
ad4b27ac
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/Attic/predmig.c,v 1.1
6 1999/02/12 06:43:31
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/Attic/predmig.c,v 1.1
7 1999/02/12 17:24:50
momjian Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -53,13 +53,13 @@
...
@@ -53,13 +53,13 @@
* (not a join) iff it has
* (not a join) iff it has
* a non-NULL cinfo field */
* a non-NULL cinfo field */
static
void
xfunc_predmig
(
Nest
Path
pathnode
,
Stream
streamroot
,
static
void
xfunc_predmig
(
Join
Path
pathnode
,
Stream
streamroot
,
Stream
laststream
,
bool
*
progressp
);
Stream
laststream
,
bool
*
progressp
);
static
bool
xfunc_series_llel
(
Stream
stream
);
static
bool
xfunc_series_llel
(
Stream
stream
);
static
bool
xfunc_llel_chains
(
Stream
root
,
Stream
bottom
);
static
bool
xfunc_llel_chains
(
Stream
root
,
Stream
bottom
);
static
Stream
xfunc_complete_stream
(
Stream
stream
);
static
Stream
xfunc_complete_stream
(
Stream
stream
);
static
bool
xfunc_prdmig_pullup
(
Stream
origstream
,
Stream
pullme
,
static
bool
xfunc_prdmig_pullup
(
Stream
origstream
,
Stream
pullme
,
Nest
Path
joinpath
);
Join
Path
joinpath
);
static
void
xfunc_form_groups
(
Stream
root
,
Stream
bottom
);
static
void
xfunc_form_groups
(
Stream
root
,
Stream
bottom
);
static
void
xfunc_free_stream
(
Stream
root
);
static
void
xfunc_free_stream
(
Stream
root
);
static
Stream
xfunc_add_clauses
(
Stream
current
);
static
Stream
xfunc_add_clauses
(
Stream
current
);
...
@@ -91,8 +91,8 @@ xfunc_do_predmig(Path root)
...
@@ -91,8 +91,8 @@ xfunc_do_predmig(Path root)
do
do
{
{
progress
=
false
;
progress
=
false
;
Assert
(
IsA
(
root
,
Nest
Path
));
Assert
(
IsA
(
root
,
Join
Path
));
xfunc_predmig
((
Nest
Path
)
root
,
(
Stream
)
NULL
,
(
Stream
)
NULL
,
xfunc_predmig
((
Join
Path
)
root
,
(
Stream
)
NULL
,
(
Stream
)
NULL
,
&
progress
);
&
progress
);
if
(
changed
&&
progress
)
if
(
changed
&&
progress
)
elog
(
DEBUG
,
"Needed to do a second round of predmig!
\n
"
);
elog
(
DEBUG
,
"Needed to do a second round of predmig!
\n
"
);
...
@@ -111,7 +111,7 @@ xfunc_do_predmig(Path root)
...
@@ -111,7 +111,7 @@ xfunc_do_predmig(Path root)
** Destructively modifies the join tree (via predicate pullup).
** Destructively modifies the join tree (via predicate pullup).
*/
*/
static
void
static
void
xfunc_predmig
(
Nest
Path
pathnode
,
/* root of the join tree */
xfunc_predmig
(
Join
Path
pathnode
,
/* root of the join tree */
Stream
streamroot
,
Stream
streamroot
,
Stream
laststream
,
/* for recursive calls -- these are the
Stream
laststream
,
/* for recursive calls -- these are the
* root of the stream under construction,
* root of the stream under construction,
...
@@ -161,11 +161,11 @@ xfunc_predmig(NestPath pathnode,/* root of the join tree */
...
@@ -161,11 +161,11 @@ xfunc_predmig(NestPath pathnode,/* root of the join tree */
else
else
{
{
/* visit left child */
/* visit left child */
xfunc_predmig
((
Nest
Path
)
get_outerjoinpath
(
pathnode
),
xfunc_predmig
((
Join
Path
)
get_outerjoinpath
(
pathnode
),
streamroot
,
newstream
,
progressp
);
streamroot
,
newstream
,
progressp
);
/* visit right child */
/* visit right child */
xfunc_predmig
((
Nest
Path
)
get_innerjoinpath
(
pathnode
),
xfunc_predmig
((
Join
Path
)
get_innerjoinpath
(
pathnode
),
streamroot
,
newstream
,
progressp
);
streamroot
,
newstream
,
progressp
);
}
}
...
@@ -257,7 +257,7 @@ xfunc_llel_chains(Stream root, Stream bottom)
...
@@ -257,7 +257,7 @@ xfunc_llel_chains(Stream root, Stream bottom)
*/
*/
Assert
(
xfunc_num_relids
(
pathstream
)
>
xfunc_num_relids
(
tmpstream
));
Assert
(
xfunc_num_relids
(
pathstream
)
>
xfunc_num_relids
(
tmpstream
));
progress
=
xfunc_prdmig_pullup
(
origstream
,
tmpstream
,
progress
=
xfunc_prdmig_pullup
(
origstream
,
tmpstream
,
(
Nest
Path
)
get_pathptr
(
pathstream
));
(
Join
Path
)
get_pathptr
(
pathstream
));
}
}
if
(
get_downstream
(
tmpstream
))
if
(
get_downstream
(
tmpstream
))
pathstream
=
(
Stream
)
xfunc_get_downjoin
((
Stream
)
get_downstream
(
tmpstream
));
pathstream
=
(
Stream
)
xfunc_get_downjoin
((
Stream
)
get_downstream
(
tmpstream
));
...
@@ -304,14 +304,14 @@ xfunc_complete_stream(Stream stream)
...
@@ -304,14 +304,14 @@ xfunc_complete_stream(Stream stream)
/*
/*
** xfunc_prdmig_pullup
** xfunc_prdmig_pullup
** pullup a clause in a path above joinpath. Since the
Nest
Path tree
** pullup a clause in a path above joinpath. Since the
Join
Path tree
** doesn't have upward pointers, it's difficult to deal with. Thus we
** doesn't have upward pointers, it's difficult to deal with. Thus we
** require the original stream, which maintains pointers to all the path
** require the original stream, which maintains pointers to all the path
** nodes. We use the original stream to find out what joins are
** nodes. We use the original stream to find out what joins are
** above the clause.
** above the clause.
*/
*/
static
bool
static
bool
xfunc_prdmig_pullup
(
Stream
origstream
,
Stream
pullme
,
Nest
Path
joinpath
)
xfunc_prdmig_pullup
(
Stream
origstream
,
Stream
pullme
,
Join
Path
joinpath
)
{
{
RestrictInfo
restrictinfo
=
get_cinfo
(
pullme
);
RestrictInfo
restrictinfo
=
get_cinfo
(
pullme
);
bool
progress
=
false
;
bool
progress
=
false
;
...
@@ -333,7 +333,7 @@ xfunc_prdmig_pullup(Stream origstream, Stream pullme, NestPath joinpath)
...
@@ -333,7 +333,7 @@ xfunc_prdmig_pullup(Stream origstream, Stream pullme, NestPath joinpath)
/* pull up this node as far as it should go */
/* pull up this node as far as it should go */
for
(
upjoin
=
(
Stream
)
xfunc_get_upjoin
(
orignode
);
for
(
upjoin
=
(
Stream
)
xfunc_get_upjoin
(
orignode
);
upjoin
!=
(
Stream
)
NULL
upjoin
!=
(
Stream
)
NULL
&&
(
Nest
Path
)
get_pathptr
((
Stream
)
xfunc_get_downjoin
(
upjoin
))
&&
(
Join
Path
)
get_pathptr
((
Stream
)
xfunc_get_downjoin
(
upjoin
))
!=
joinpath
;
!=
joinpath
;
upjoin
=
(
Stream
)
xfunc_get_upjoin
(
upjoin
))
upjoin
=
(
Stream
)
xfunc_get_upjoin
(
upjoin
))
{
{
...
@@ -342,12 +342,12 @@ xfunc_prdmig_pullup(Stream origstream, Stream pullme, NestPath joinpath)
...
@@ -342,12 +342,12 @@ xfunc_prdmig_pullup(Stream origstream, Stream pullme, NestPath joinpath)
#endif
#endif
/* move clause up in path */
/* move clause up in path */
if
(
get_pathptr
((
Stream
)
get_downstream
(
upjoin
))
if
(
get_pathptr
((
Stream
)
get_downstream
(
upjoin
))
==
(
pathPtr
)
get_outerjoinpath
((
Nest
Path
)
get_pathptr
(
upjoin
)))
==
(
pathPtr
)
get_outerjoinpath
((
Join
Path
)
get_pathptr
(
upjoin
)))
whichchild
=
OUTER
;
whichchild
=
OUTER
;
else
else
whichchild
=
INNER
;
whichchild
=
INNER
;
restrictinfo
=
xfunc_pullup
((
Path
)
get_pathptr
((
Stream
)
get_downstream
(
upjoin
)),
restrictinfo
=
xfunc_pullup
((
Path
)
get_pathptr
((
Stream
)
get_downstream
(
upjoin
)),
(
Nest
Path
)
get_pathptr
(
upjoin
),
(
Join
Path
)
get_pathptr
(
upjoin
),
restrictinfo
,
restrictinfo
,
whichchild
,
whichchild
,
get_clausetype
(
orignode
));
get_clausetype
(
orignode
));
...
@@ -366,10 +366,10 @@ xfunc_prdmig_pullup(Stream origstream, Stream pullme, NestPath joinpath)
...
@@ -366,10 +366,10 @@ xfunc_prdmig_pullup(Stream origstream, Stream pullme, NestPath joinpath)
temp
=
(
Stream
)
get_downstream
(
temp
))
temp
=
(
Stream
)
get_downstream
(
temp
))
set_pathptr
set_pathptr
(
temp
,
(
pathPtr
)
(
temp
,
(
pathPtr
)
get_outerjoinpath
((
Nest
Path
)
get_pathptr
(
upjoin
)));
get_outerjoinpath
((
Join
Path
)
get_pathptr
(
upjoin
)));
set_pathptr
set_pathptr
(
temp
,
(
temp
,
(
pathPtr
)
get_outerjoinpath
((
Nest
Path
)
get_pathptr
(
upjoin
)));
(
pathPtr
)
get_outerjoinpath
((
Join
Path
)
get_pathptr
(
upjoin
)));
}
}
else
else
{
{
...
@@ -377,10 +377,10 @@ xfunc_prdmig_pullup(Stream origstream, Stream pullme, NestPath joinpath)
...
@@ -377,10 +377,10 @@ xfunc_prdmig_pullup(Stream origstream, Stream pullme, NestPath joinpath)
temp
=
(
Stream
)
get_downstream
(
temp
))
temp
=
(
Stream
)
get_downstream
(
temp
))
set_pathptr
set_pathptr
(
temp
,
(
pathPtr
)
(
temp
,
(
pathPtr
)
get_innerjoinpath
((
Nest
Path
)
get_pathptr
(
upjoin
)));
get_innerjoinpath
((
Join
Path
)
get_pathptr
(
upjoin
)));
set_pathptr
set_pathptr
(
temp
,
(
pathPtr
)
(
temp
,
(
pathPtr
)
get_innerjoinpath
((
Nest
Path
)
get_pathptr
(
upjoin
)));
get_innerjoinpath
((
Join
Path
)
get_pathptr
(
upjoin
)));
}
}
progress
=
true
;
progress
=
true
;
}
}
...
@@ -425,14 +425,14 @@ xfunc_form_groups(Query *queryInfo, Stream root, Stream bottom)
...
@@ -425,14 +425,14 @@ xfunc_form_groups(Query *queryInfo, Stream root, Stream bottom)
if
(
!
is_clause
(
temp
))
if
(
!
is_clause
(
temp
))
{
{
if
(
get_pathptr
((
Stream
)
get_downstream
(
temp
))
if
(
get_pathptr
((
Stream
)
get_downstream
(
temp
))
==
(
pathPtr
)
get_outerjoinpath
((
Nest
Path
)
get_pathptr
(
temp
)))
==
(
pathPtr
)
get_outerjoinpath
((
Join
Path
)
get_pathptr
(
temp
)))
whichchild
=
OUTER
;
whichchild
=
OUTER
;
else
else
whichchild
=
INNER
;
whichchild
=
INNER
;
set_groupcost
(
temp
,
set_groupcost
(
temp
,
xfunc_join_expense
((
Nest
Path
)
get_pathptr
(
temp
),
xfunc_join_expense
((
Join
Path
)
get_pathptr
(
temp
),
whichchild
));
whichchild
));
if
(
primjoin
=
xfunc_primary_join
((
Nest
Path
)
get_pathptr
(
temp
)))
if
(
primjoin
=
xfunc_primary_join
((
Join
Path
)
get_pathptr
(
temp
)))
{
{
set_groupsel
(
temp
,
set_groupsel
(
temp
,
compute_clause_selec
(
queryInfo
,
compute_clause_selec
(
queryInfo
,
...
@@ -529,10 +529,10 @@ xfunc_add_clauses(Stream current)
...
@@ -529,10 +529,10 @@ xfunc_add_clauses(Stream current)
}
}
/* and add in the join clauses */
/* and add in the join clauses */
if
(
IsA
(
get_pathptr
(
current
),
Nest
Path
))
if
(
IsA
(
get_pathptr
(
current
),
Join
Path
))
{
{
primjoin
=
xfunc_primary_join
((
Nest
Path
)
get_pathptr
(
current
));
primjoin
=
xfunc_primary_join
((
Join
Path
)
get_pathptr
(
current
));
foreach
(
temp
,
get_pathrestrictinfo
((
Nest
Path
)
get_pathptr
(
current
)))
foreach
(
temp
,
get_pathrestrictinfo
((
Join
Path
)
get_pathptr
(
current
)))
{
{
if
(
!
equal
(
get_clause
((
RestrictInfo
)
lfirst
(
temp
)),
primjoin
))
if
(
!
equal
(
get_clause
((
RestrictInfo
)
lfirst
(
temp
)),
primjoin
))
topnode
=
xfunc_streaminsert
((
RestrictInfo
)
lfirst
(
temp
),
topnode
,
topnode
=
xfunc_streaminsert
((
RestrictInfo
)
lfirst
(
temp
),
topnode
,
...
@@ -615,11 +615,11 @@ xfunc_streaminsert(RestrictInfo restrictinfo,
...
@@ -615,11 +615,11 @@ xfunc_streaminsert(RestrictInfo restrictinfo,
static
int
static
int
xfunc_num_relids
(
Stream
node
)
xfunc_num_relids
(
Stream
node
)
{
{
if
(
!
node
||
!
IsA
(
get_pathptr
(
node
),
Nest
Path
))
if
(
!
node
||
!
IsA
(
get_pathptr
(
node
),
Join
Path
))
return
0
;
return
0
;
else
else
return
(
length
return
(
length
(
get_relids
(
get_parent
((
Nest
Path
)
get_pathptr
(
node
)))));
(
get_relids
(
get_parent
((
Join
Path
)
get_pathptr
(
node
)))));
}
}
/*
/*
...
...
src/backend/optimizer/path/prune.c
View file @
ad4b27ac
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/Attic/prune.c,v 1.
29 1999/02/12 06:43:32
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/Attic/prune.c,v 1.
30 1999/02/12 17:24:50
momjian Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -92,17 +92,17 @@ rels_set_cheapest(List *rel_list)
...
@@ -92,17 +92,17 @@ rels_set_cheapest(List *rel_list)
{
{
List
*
x
=
NIL
;
List
*
x
=
NIL
;
RelOptInfo
*
rel
=
(
RelOptInfo
*
)
NULL
;
RelOptInfo
*
rel
=
(
RelOptInfo
*
)
NULL
;
Nest
Path
*
cheapest
;
Join
Path
*
cheapest
;
foreach
(
x
,
rel_list
)
foreach
(
x
,
rel_list
)
{
{
rel
=
(
RelOptInfo
*
)
lfirst
(
x
);
rel
=
(
RelOptInfo
*
)
lfirst
(
x
);
cheapest
=
(
Nest
Path
*
)
set_cheapest
(
rel
,
rel
->
pathlist
);
cheapest
=
(
Join
Path
*
)
set_cheapest
(
rel
,
rel
->
pathlist
);
if
(
IsA_JoinPath
(
cheapest
))
if
(
IsA_JoinPath
(
cheapest
))
rel
->
size
=
compute_joinrel_size
(
cheapest
);
rel
->
size
=
compute_joinrel_size
(
cheapest
);
else
else
elog
(
ERROR
,
"non
Nest
Path called"
);
elog
(
ERROR
,
"non
Join
Path called"
);
}
}
}
}
...
...
src/backend/optimizer/path/xfunc.c
View file @
ad4b27ac
...
@@ -9,7 +9,7 @@
...
@@ -9,7 +9,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/Attic/xfunc.c,v 1.2
6 1999/02/12 06:43:32
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/Attic/xfunc.c,v 1.2
7 1999/02/12 17:24:50
momjian Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -61,7 +61,7 @@ xfunc_trypullup(RelOptInfo rel)
...
@@ -61,7 +61,7 @@ xfunc_trypullup(RelOptInfo rel)
LispValue
y
;
/* list ptr */
LispValue
y
;
/* list ptr */
RestrictInfo
maxcinfo
;
/* The RestrictInfo to pull up, as
RestrictInfo
maxcinfo
;
/* The RestrictInfo to pull up, as
* calculated by xfunc_shouldpull() */
* calculated by xfunc_shouldpull() */
Nest
Path
curpath
;
/* current path in list */
Join
Path
curpath
;
/* current path in list */
int
progress
;
/* has progress been made this time
int
progress
;
/* has progress been made this time
* through? */
* through? */
int
clausetype
;
int
clausetype
;
...
@@ -71,7 +71,7 @@ xfunc_trypullup(RelOptInfo rel)
...
@@ -71,7 +71,7 @@ xfunc_trypullup(RelOptInfo rel)
progress
=
false
;
/* no progress yet in this iteration */
progress
=
false
;
/* no progress yet in this iteration */
foreach
(
y
,
get_pathlist
(
rel
))
foreach
(
y
,
get_pathlist
(
rel
))
{
{
curpath
=
(
Nest
Path
)
lfirst
(
y
);
curpath
=
(
Join
Path
)
lfirst
(
y
);
/*
/*
* * for each operand, attempt to pullup predicates until
* * for each operand, attempt to pullup predicates until
...
@@ -142,7 +142,7 @@ xfunc_trypullup(RelOptInfo rel)
...
@@ -142,7 +142,7 @@ xfunc_trypullup(RelOptInfo rel)
int
int
xfunc_shouldpull
(
Query
*
queryInfo
,
xfunc_shouldpull
(
Query
*
queryInfo
,
Path
childpath
,
Path
childpath
,
Nest
Path
parentpath
,
Join
Path
parentpath
,
int
whichchild
,
int
whichchild
,
RestrictInfo
*
maxcinfopt
)
/* Out: pointer to clause
RestrictInfo
*
maxcinfopt
)
/* Out: pointer to clause
* to pullup */
* to pullup */
...
@@ -184,8 +184,8 @@ xfunc_shouldpull(Query *queryInfo,
...
@@ -184,8 +184,8 @@ xfunc_shouldpull(Query *queryInfo,
* see if any join clause has even higher rank than the highest *
* see if any join clause has even higher rank than the highest *
* local predicate
* local predicate
*/
*/
if
(
is_join
(
childpath
)
&&
xfunc_num_join_clauses
((
Nest
Path
)
childpath
)
>
1
)
if
(
is_join
(
childpath
)
&&
xfunc_num_join_clauses
((
Join
Path
)
childpath
)
>
1
)
for
(
tmplist
=
get_pathrestrictinfo
((
Nest
Path
)
childpath
);
for
(
tmplist
=
get_pathrestrictinfo
((
Join
Path
)
childpath
);
tmplist
!=
LispNil
;
tmplist
!=
LispNil
;
tmplist
=
lnext
(
tmplist
))
tmplist
=
lnext
(
tmplist
))
{
{
...
@@ -263,7 +263,7 @@ xfunc_shouldpull(Query *queryInfo,
...
@@ -263,7 +263,7 @@ xfunc_shouldpull(Query *queryInfo,
RestrictInfo
RestrictInfo
xfunc_pullup
(
Query
*
queryInfo
,
xfunc_pullup
(
Query
*
queryInfo
,
Path
childpath
,
Path
childpath
,
Nest
Path
parentpath
,
Join
Path
parentpath
,
RestrictInfo
cinfo
,
/* clause to pull up */
RestrictInfo
cinfo
,
/* clause to pull up */
int
whichchild
,
/* whether child is INNER or OUTER of join */
int
whichchild
,
/* whether child is INNER or OUTER of join */
int
clausetype
)
/* whether clause to pull is join or local */
int
clausetype
)
/* whether clause to pull is join or local */
...
@@ -285,9 +285,9 @@ xfunc_pullup(Query *queryInfo,
...
@@ -285,9 +285,9 @@ xfunc_pullup(Query *queryInfo,
else
else
{
{
set_pathrestrictinfo
set_pathrestrictinfo
((
Nest
Path
)
newkid
,
((
Join
Path
)
newkid
,
xfunc_LispRemove
((
LispValue
)
cinfo
,
xfunc_LispRemove
((
LispValue
)
cinfo
,
(
List
)
get_pathrestrictinfo
((
Nest
Path
)
newkid
)));
(
List
)
get_pathrestrictinfo
((
Join
Path
)
newkid
)));
}
}
/*
/*
...
@@ -390,7 +390,7 @@ LispValue clause;
...
@@ -390,7 +390,7 @@ LispValue clause;
** Find global expense of a join clause
** Find global expense of a join clause
*/
*/
Cost
Cost
xfunc_join_expense
(
Query
*
queryInfo
,
Nest
Path
path
,
int
whichchild
)
xfunc_join_expense
(
Query
*
queryInfo
,
Join
Path
path
,
int
whichchild
)
{
{
LispValue
primjoinclause
=
xfunc_primary_join
(
path
);
LispValue
primjoinclause
=
xfunc_primary_join
(
path
);
...
@@ -854,7 +854,7 @@ xfunc_find_references(LispValue clause)
...
@@ -854,7 +854,7 @@ xfunc_find_references(LispValue clause)
** min rank pathclause
** min rank pathclause
*/
*/
LispValue
LispValue
xfunc_primary_join
(
Nest
Path
pathnode
)
xfunc_primary_join
(
Join
Path
pathnode
)
{
{
LispValue
joinclauselist
=
get_pathrestrictinfo
(
pathnode
);
LispValue
joinclauselist
=
get_pathrestrictinfo
(
pathnode
);
RestrictInfo
mincinfo
;
RestrictInfo
mincinfo
;
...
@@ -947,13 +947,13 @@ xfunc_get_path_cost(Query *queryInfo, Path pathnode)
...
@@ -947,13 +947,13 @@ xfunc_get_path_cost(Query *queryInfo, Path pathnode)
* * Now add in any node-specific expensive function costs. * Again,
* * Now add in any node-specific expensive function costs. * Again,
* we must ensure that the clauses are sorted by rank.
* we must ensure that the clauses are sorted by rank.
*/
*/
if
(
IsA
(
pathnode
,
Nest
Path
))
if
(
IsA
(
pathnode
,
Join
Path
))
{
{
if
(
XfuncMode
!=
XFUNC_OFF
)
if
(
XfuncMode
!=
XFUNC_OFF
)
set_pathrestrictinfo
((
Nest
Path
)
pathnode
,
lisp_qsort
set_pathrestrictinfo
((
Join
Path
)
pathnode
,
lisp_qsort
(
get_pathrestrictinfo
((
Nest
Path
)
pathnode
),
(
get_pathrestrictinfo
((
Join
Path
)
pathnode
),
xfunc_cinfo_compare
));
xfunc_cinfo_compare
));
for
(
tmplist
=
get_pathrestrictinfo
((
Nest
Path
)
pathnode
),
selec
=
1
.
0
;
for
(
tmplist
=
get_pathrestrictinfo
((
Join
Path
)
pathnode
),
selec
=
1
.
0
;
tmplist
!=
LispNil
;
tmplist
!=
LispNil
;
tmplist
=
lnext
(
tmplist
))
tmplist
=
lnext
(
tmplist
))
{
{
...
@@ -1006,14 +1006,14 @@ xfunc_get_path_cost(Query *queryInfo, Path pathnode)
...
@@ -1006,14 +1006,14 @@ xfunc_get_path_cost(Query *queryInfo, Path pathnode)
** Recalculate the cost of a path node. This includes the basic cost of the
** Recalculate the cost of a path node. This includes the basic cost of the
** node, as well as the cost of its expensive functions.
** node, as well as the cost of its expensive functions.
** We need to do this to the parent after pulling a clause from a child into a
** We need to do this to the parent after pulling a clause from a child into a
** parent. Thus we should only be calling this function on
Nest
Paths.
** parent. Thus we should only be calling this function on
Join
Paths.
*/
*/
Cost
Cost
xfunc_total_path_cost
(
Nest
Path
pathnode
)
xfunc_total_path_cost
(
Join
Path
pathnode
)
{
{
Cost
cost
=
xfunc_get_path_cost
((
Path
)
pathnode
);
Cost
cost
=
xfunc_get_path_cost
((
Path
)
pathnode
);
Assert
(
IsA
(
pathnode
,
Nest
Path
));
Assert
(
IsA
(
pathnode
,
Join
Path
));
if
(
IsA
(
pathnode
,
MergePath
))
if
(
IsA
(
pathnode
,
MergePath
))
{
{
MergePath
mrgnode
=
(
MergePath
)
pathnode
;
MergePath
mrgnode
=
(
MergePath
)
pathnode
;
...
@@ -1089,7 +1089,7 @@ xfunc_total_path_cost(NestPath pathnode)
...
@@ -1089,7 +1089,7 @@ xfunc_total_path_cost(NestPath pathnode)
*/
*/
Cost
Cost
xfunc_expense_per_tuple
(
Nest
Path
joinnode
,
int
whichchild
)
xfunc_expense_per_tuple
(
Join
Path
joinnode
,
int
whichchild
)
{
{
RelOptInfo
outerrel
=
get_parent
((
Path
)
get_outerjoinpath
(
joinnode
));
RelOptInfo
outerrel
=
get_parent
((
Path
)
get_outerjoinpath
(
joinnode
));
RelOptInfo
innerrel
=
get_parent
((
Path
)
get_innerjoinpath
(
joinnode
));
RelOptInfo
innerrel
=
get_parent
((
Path
)
get_innerjoinpath
(
joinnode
));
...
@@ -1118,7 +1118,7 @@ xfunc_expense_per_tuple(NestPath joinnode, int whichchild)
...
@@ -1118,7 +1118,7 @@ xfunc_expense_per_tuple(NestPath joinnode, int whichchild)
else
else
/* nestloop */
/* nestloop */
{
{
Assert
(
IsA
(
joinnode
,
Nest
Path
));
Assert
(
IsA
(
joinnode
,
Join
Path
));
return
_CPU_PAGE_WEIGHT_
;
return
_CPU_PAGE_WEIGHT_
;
}
}
}
}
...
@@ -1375,7 +1375,7 @@ xfunc_tuple_width(Relation rd)
...
@@ -1375,7 +1375,7 @@ xfunc_tuple_width(Relation rd)
** Find the number of join clauses associated with this join path
** Find the number of join clauses associated with this join path
*/
*/
int
int
xfunc_num_join_clauses
(
Nest
Path
path
)
xfunc_num_join_clauses
(
Join
Path
path
)
{
{
int
num
=
length
(
get_pathrestrictinfo
(
path
));
int
num
=
length
(
get_pathrestrictinfo
(
path
));
...
...
src/backend/optimizer/plan/createplan.c
View file @
ad4b27ac
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/optimizer/plan/createplan.c,v 1.4
4 1999/02/12 06:43:33
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/optimizer/plan/createplan.c,v 1.4
5 1999/02/12 17:24:51
momjian Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -45,7 +45,7 @@
...
@@ -45,7 +45,7 @@
static
List
*
switch_outer
(
List
*
clauses
);
static
List
*
switch_outer
(
List
*
clauses
);
static
Scan
*
create_scan_node
(
Path
*
best_path
,
List
*
tlist
);
static
Scan
*
create_scan_node
(
Path
*
best_path
,
List
*
tlist
);
static
Join
*
create_join_node
(
Nest
Path
*
best_path
,
List
*
tlist
);
static
Join
*
create_join_node
(
Join
Path
*
best_path
,
List
*
tlist
);
static
SeqScan
*
create_seqscan_node
(
Path
*
best_path
,
List
*
tlist
,
static
SeqScan
*
create_seqscan_node
(
Path
*
best_path
,
List
*
tlist
,
List
*
scan_clauses
);
List
*
scan_clauses
);
static
IndexScan
*
create_indexscan_node
(
IndexPath
*
best_path
,
List
*
tlist
,
static
IndexScan
*
create_indexscan_node
(
IndexPath
*
best_path
,
List
*
tlist
,
...
@@ -117,7 +117,7 @@ create_plan(Path *best_path)
...
@@ -117,7 +117,7 @@ create_plan(Path *best_path)
case
T_HashJoin
:
case
T_HashJoin
:
case
T_MergeJoin
:
case
T_MergeJoin
:
case
T_NestLoop
:
case
T_NestLoop
:
plan_node
=
(
Plan
*
)
create_join_node
((
Nest
Path
*
)
best_path
,
tlist
);
plan_node
=
(
Plan
*
)
create_join_node
((
Join
Path
*
)
best_path
,
tlist
);
break
;
break
;
default:
default:
/* do nothing */
/* do nothing */
...
@@ -204,7 +204,7 @@ create_scan_node(Path *best_path, List *tlist)
...
@@ -204,7 +204,7 @@ create_scan_node(Path *best_path, List *tlist)
* Returns the join node.
* Returns the join node.
*/
*/
static
Join
*
static
Join
*
create_join_node
(
Nest
Path
*
best_path
,
List
*
tlist
)
create_join_node
(
Join
Path
*
best_path
,
List
*
tlist
)
{
{
Plan
*
outer_node
;
Plan
*
outer_node
;
List
*
outer_tlist
;
List
*
outer_tlist
;
...
...
src/include/executor/nodeNestloop.h
View file @
ad4b27ac
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
*
*
* Copyright (c) 1994, Regents of the University of California
* Copyright (c) 1994, Regents of the University of California
*
*
* $Id: nodeNestloop.h,v 1.
7 1998/09/01 04:36:03
momjian Exp $
* $Id: nodeNestloop.h,v 1.
8 1999/02/12 17:24:55
momjian Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -21,6 +21,7 @@ extern TupleTableSlot *ExecNestLoop(NestLoop *node, Plan *parent);
...
@@ -21,6 +21,7 @@ extern TupleTableSlot *ExecNestLoop(NestLoop *node, Plan *parent);
extern
bool
ExecInitNestLoop
(
NestLoop
*
node
,
EState
*
estate
,
Plan
*
parent
);
extern
bool
ExecInitNestLoop
(
NestLoop
*
node
,
EState
*
estate
,
Plan
*
parent
);
extern
int
ExecCountSlotsNestLoop
(
NestLoop
*
node
);
extern
int
ExecCountSlotsNestLoop
(
NestLoop
*
node
);
extern
void
ExecEndNestLoop
(
NestLoop
*
node
);
extern
void
ExecEndNestLoop
(
NestLoop
*
node
);
extern
void
ExecReScanNestLoop
(
NestLoop
*
node
,
ExprContext
*
exprCtxt
,
Plan
*
parent
);
extern
void
ExecReScanNestLoop
(
NestLoop
*
node
,
ExprContext
*
exprCtxt
,
Plan
*
parent
);
#endif
/* NODENESTLOOP_H */
#endif
/* NODENESTLOOP_H */
src/include/nodes/relation.h
View file @
ad4b27ac
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
*
*
* Copyright (c) 1994, Regents of the University of California
* Copyright (c) 1994, Regents of the University of California
*
*
* $Id: relation.h,v 1.2
1 1999/02/12 06:43:47
momjian Exp $
* $Id: relation.h,v 1.2
2 1999/02/12 17:24:59
momjian Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -168,9 +168,11 @@ typedef struct NestPath
...
@@ -168,9 +168,11 @@ typedef struct NestPath
Path
*
innerjoinpath
;
Path
*
innerjoinpath
;
}
NestPath
;
}
NestPath
;
typedef
NestPath
JoinPath
;
typedef
struct
MergePath
typedef
struct
MergePath
{
{
Nest
Path
jpath
;
Join
Path
jpath
;
List
*
path_mergeclauses
;
List
*
path_mergeclauses
;
List
*
outersortkeys
;
List
*
outersortkeys
;
List
*
innersortkeys
;
List
*
innersortkeys
;
...
@@ -178,7 +180,7 @@ typedef struct MergePath
...
@@ -178,7 +180,7 @@ typedef struct MergePath
typedef
struct
HashPath
typedef
struct
HashPath
{
{
Nest
Path
jpath
;
Join
Path
jpath
;
List
*
path_hashclauses
;
List
*
path_hashclauses
;
List
*
outerhashkeys
;
List
*
outerhashkeys
;
List
*
innerhashkeys
;
List
*
innerhashkeys
;
...
@@ -262,7 +264,7 @@ typedef struct Iter
...
@@ -262,7 +264,7 @@ typedef struct Iter
/*
/*
** Stream:
** Stream:
** A stream represents a root-to-leaf path in a plan tree (i.e. a tree of
** A stream represents a root-to-leaf path in a plan tree (i.e. a tree of
**
Nest
Paths and Paths). The stream includes pointers to all Path nodes,
**
Join
Paths and Paths). The stream includes pointers to all Path nodes,
** as well as to any clauses that reside above Path nodes. This structure
** as well as to any clauses that reside above Path nodes. This structure
** is used to make Path nodes and clauses look similar, so that Predicate
** is used to make Path nodes and clauses look similar, so that Predicate
** Migration can run.
** Migration can run.
...
...
src/include/optimizer/cost.h
View file @
ad4b27ac
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
*
*
* Copyright (c) 1994, Regents of the University of California
* Copyright (c) 1994, Regents of the University of California
*
*
* $Id: cost.h,v 1.1
5 1999/02/12 06:43:52
momjian Exp $
* $Id: cost.h,v 1.1
6 1999/02/12 17:25:05
momjian Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -45,7 +45,7 @@ extern Cost cost_hashjoin(Cost outercost, Cost innercost, List *outerkeys,
...
@@ -45,7 +45,7 @@ extern Cost cost_hashjoin(Cost outercost, Cost innercost, List *outerkeys,
int
outerwidth
,
int
innerwidth
);
int
outerwidth
,
int
innerwidth
);
extern
int
compute_rel_size
(
RelOptInfo
*
rel
);
extern
int
compute_rel_size
(
RelOptInfo
*
rel
);
extern
int
compute_rel_width
(
RelOptInfo
*
rel
);
extern
int
compute_rel_width
(
RelOptInfo
*
rel
);
extern
int
compute_joinrel_size
(
Nest
Path
*
joinpath
);
extern
int
compute_joinrel_size
(
Join
Path
*
joinpath
);
extern
int
page_size
(
int
tuples
,
int
width
);
extern
int
page_size
(
int
tuples
,
int
width
);
/*
/*
...
...
src/include/optimizer/xfunc.h
View file @
ad4b27ac
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
*
*
* Copyright (c) 1994, Regents of the University of California
* Copyright (c) 1994, Regents of the University of California
*
*
* $Id: xfunc.h,v 1.1
3 1999/02/12 06:43:53
momjian Exp $
* $Id: xfunc.h,v 1.1
4 1999/02/12 17:25:05
momjian Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -50,13 +50,13 @@ extern int XfuncMode; /* defined in tcop/postgres.c */
...
@@ -50,13 +50,13 @@ extern int XfuncMode; /* defined in tcop/postgres.c */
/* function prototypes from planner/path/xfunc.c */
/* function prototypes from planner/path/xfunc.c */
extern
void
xfunc_trypullup
(
RelOptInfo
*
rel
);
extern
void
xfunc_trypullup
(
RelOptInfo
*
rel
);
extern
int
xfunc_shouldpull
(
Path
*
childpath
,
Nest
Path
*
parentpath
,
extern
int
xfunc_shouldpull
(
Path
*
childpath
,
Join
Path
*
parentpath
,
int
whichchild
,
RestrictInfo
*
maxcinfopt
);
int
whichchild
,
RestrictInfo
*
maxcinfopt
);
extern
RestrictInfo
*
xfunc_pullup
(
Path
*
childpath
,
Nest
Path
*
parentpath
,
RestrictInfo
*
cinfo
,
extern
RestrictInfo
*
xfunc_pullup
(
Path
*
childpath
,
Join
Path
*
parentpath
,
RestrictInfo
*
cinfo
,
int
whichchild
,
int
clausetype
);
int
whichchild
,
int
clausetype
);
extern
Cost
xfunc_rank
(
Expr
*
clause
);
extern
Cost
xfunc_rank
(
Expr
*
clause
);
extern
Cost
xfunc_expense
(
Query
*
queryInfo
,
Expr
*
clause
);
extern
Cost
xfunc_expense
(
Query
*
queryInfo
,
Expr
*
clause
);
extern
Cost
xfunc_join_expense
(
Nest
Path
*
path
,
int
whichchild
);
extern
Cost
xfunc_join_expense
(
Join
Path
*
path
,
int
whichchild
);
extern
Cost
xfunc_local_expense
(
Expr
*
clause
);
extern
Cost
xfunc_local_expense
(
Expr
*
clause
);
extern
Cost
xfunc_func_expense
(
Expr
*
node
,
List
*
args
);
extern
Cost
xfunc_func_expense
(
Expr
*
node
,
List
*
args
);
extern
int
xfunc_width
(
Expr
*
clause
);
extern
int
xfunc_width
(
Expr
*
clause
);
...
@@ -65,10 +65,10 @@ extern int xfunc_width(Expr *clause);
...
@@ -65,10 +65,10 @@ extern int xfunc_width(Expr *clause);
/* extern int xfunc_card_unreferenced(Expr *clause, Relid referenced); */
/* extern int xfunc_card_unreferenced(Expr *clause, Relid referenced); */
extern
int
xfunc_card_product
(
Relid
relids
);
extern
int
xfunc_card_product
(
Relid
relids
);
extern
List
*
xfunc_find_references
(
List
*
clause
);
extern
List
*
xfunc_find_references
(
List
*
clause
);
extern
List
*
xfunc_primary_join
(
Nest
Path
*
pathnode
);
extern
List
*
xfunc_primary_join
(
Join
Path
*
pathnode
);
extern
Cost
xfunc_get_path_cost
(
Path
*
pathnode
);
extern
Cost
xfunc_get_path_cost
(
Path
*
pathnode
);
extern
Cost
xfunc_total_path_cost
(
Nest
Path
*
pathnode
);
extern
Cost
xfunc_total_path_cost
(
Join
Path
*
pathnode
);
extern
Cost
xfunc_expense_per_tuple
(
Nest
Path
*
joinnode
,
int
whichchild
);
extern
Cost
xfunc_expense_per_tuple
(
Join
Path
*
joinnode
,
int
whichchild
);
extern
void
xfunc_fixvars
(
Expr
*
clause
,
RelOptInfo
*
rel
,
int
varno
);
extern
void
xfunc_fixvars
(
Expr
*
clause
,
RelOptInfo
*
rel
,
int
varno
);
extern
int
xfunc_cinfo_compare
(
void
*
arg1
,
void
*
arg2
);
extern
int
xfunc_cinfo_compare
(
void
*
arg1
,
void
*
arg2
);
extern
int
xfunc_clause_compare
(
void
*
arg1
,
void
*
arg2
);
extern
int
xfunc_clause_compare
(
void
*
arg1
,
void
*
arg2
);
...
@@ -76,7 +76,7 @@ extern void xfunc_disjunct_sort(List *clause_list);
...
@@ -76,7 +76,7 @@ extern void xfunc_disjunct_sort(List *clause_list);
extern
int
xfunc_disjunct_compare
(
void
*
arg1
,
void
*
arg2
);
extern
int
xfunc_disjunct_compare
(
void
*
arg1
,
void
*
arg2
);
extern
int
xfunc_func_width
(
RegProcedure
funcid
,
List
*
args
);
extern
int
xfunc_func_width
(
RegProcedure
funcid
,
List
*
args
);
extern
int
xfunc_tuple_width
(
Relation
rd
);
extern
int
xfunc_tuple_width
(
Relation
rd
);
extern
int
xfunc_num_join_clauses
(
Nest
Path
*
path
);
extern
int
xfunc_num_join_clauses
(
Join
Path
*
path
);
extern
List
*
xfunc_LispRemove
(
List
*
foo
,
List
*
bar
);
extern
List
*
xfunc_LispRemove
(
List
*
foo
,
List
*
bar
);
extern
bool
xfunc_copyrel
(
RelOptInfo
*
from
,
RelOptInfo
**
to
);
extern
bool
xfunc_copyrel
(
RelOptInfo
*
from
,
RelOptInfo
**
to
);
...
...
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