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
d3f0e87d
Commit
d3f0e87d
authored
Dec 18, 1997
by
Bruce Momjian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cost cleanup.
parent
6b00ec37
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
29 additions
and
46 deletions
+29
-46
src/backend/optimizer/README
src/backend/optimizer/README
+1
-1
src/backend/optimizer/plan/createplan.c
src/backend/optimizer/plan/createplan.c
+20
-31
src/include/optimizer/planmain.h
src/include/optimizer/planmain.h
+8
-14
No files found.
src/backend/optimizer/README
View file @
d3f0e87d
...
...
@@ -52,7 +52,7 @@ planner()
if a join from the join clause adds only one relation, do the join
or find_clauseless_joins()
find_all_join_paths()
generate paths(nested,
mergesort
) for joins found in find_join_rels()
generate paths(nested,
sortmerge
) for joins found in find_join_rels()
prune_joinrels()
remove from the join list the relation we just added to each join
prune_rel_paths()
...
...
src/backend/optimizer/plan/createplan.c
View file @
d3f0e87d
...
...
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/optimizer/plan/createplan.c,v 1.1
7 1997/12/18 03:03:35
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/optimizer/plan/createplan.c,v 1.1
8 1997/12/18 12:20:30
momjian Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -46,44 +46,33 @@
static
List
*
switch_outer
(
List
*
clauses
);
static
Scan
*
create_scan_node
(
Path
*
best_path
,
List
*
tlist
);
static
Join
*
create_join_node
(
JoinPath
*
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
);
static
IndexScan
*
create_indexscan_node
(
IndexPath
*
best_path
,
List
*
tlist
,
static
IndexScan
*
create_indexscan_node
(
IndexPath
*
best_path
,
List
*
tlist
,
List
*
scan_clauses
);
static
NestLoop
*
create_nestloop_node
(
JoinPath
*
best_path
,
List
*
tlist
,
static
NestLoop
*
create_nestloop_node
(
JoinPath
*
best_path
,
List
*
tlist
,
List
*
clauses
,
Plan
*
outer_node
,
List
*
outer_tlist
,
Plan
*
inner_node
,
List
*
inner_tlist
);
static
MergeJoin
*
create_mergejoin_node
(
MergePath
*
best_path
,
List
*
tlist
,
static
MergeJoin
*
create_mergejoin_node
(
MergePath
*
best_path
,
List
*
tlist
,
List
*
clauses
,
Plan
*
outer_node
,
List
*
outer_tlist
,
Plan
*
inner_node
,
List
*
inner_tlist
);
static
HashJoin
*
create_hashjoin_node
(
HashPath
*
best_path
,
List
*
tlist
,
static
HashJoin
*
create_hashjoin_node
(
HashPath
*
best_path
,
List
*
tlist
,
List
*
clauses
,
Plan
*
outer_node
,
List
*
outer_tlist
,
Plan
*
inner_node
,
List
*
inner_tlist
);
static
Node
*
fix_indxqual_references
(
Node
*
clause
,
Path
*
index_path
);
static
Temp
*
make_temp
(
List
*
tlist
,
List
*
keys
,
Oid
*
operators
,
static
Temp
*
make_temp
(
List
*
tlist
,
List
*
keys
,
Oid
*
operators
,
Plan
*
plan_node
,
int
temptype
);
static
IndexScan
*
make_indexscan
(
List
*
qptlist
,
List
*
qpqual
,
Index
scanrelid
,
List
*
indxid
,
List
*
indxqual
);
static
NestLoop
*
make_nestloop
(
List
*
qptlist
,
List
*
qpqual
,
Plan
*
lefttree
,
static
IndexScan
*
make_indexscan
(
List
*
qptlist
,
List
*
qpqual
,
Index
scanrelid
,
List
*
indxid
,
List
*
indxqual
,
Cost
cost
);
static
NestLoop
*
make_nestloop
(
List
*
qptlist
,
List
*
qpqual
,
Plan
*
lefttree
,
Plan
*
righttree
);
static
HashJoin
*
make_hashjoin
(
List
*
tlist
,
List
*
qpqual
,
static
HashJoin
*
make_hashjoin
(
List
*
tlist
,
List
*
qpqual
,
List
*
hashclauses
,
Plan
*
lefttree
,
Plan
*
righttree
);
static
Hash
*
make_hash
(
List
*
tlist
,
Var
*
hashkey
,
Plan
*
lefttree
);
static
MergeJoin
*
make_mergesort
(
List
*
tlist
,
List
*
qpqual
,
static
MergeJoin
*
make_mergesort
(
List
*
tlist
,
List
*
qpqual
,
List
*
mergeclauses
,
Oid
opcode
,
Oid
*
rightorder
,
Oid
*
leftorder
,
Plan
*
righttree
,
Plan
*
lefttree
);
static
Material
*
make_material
(
List
*
tlist
,
Oid
tempid
,
Plan
*
lefttree
,
static
Material
*
make_material
(
List
*
tlist
,
Oid
tempid
,
Plan
*
lefttree
,
int
keycount
);
/*
...
...
@@ -415,9 +404,8 @@ create_indexscan_node(IndexPath *best_path,
qpqual
,
lfirsti
(
best_path
->
path
.
parent
->
relids
),
best_path
->
indexid
,
fixed_indxqual
);
scan_node
->
scan
.
plan
.
cost
=
best_path
->
path
.
path_cost
;
fixed_indxqual
,
best_path
->
path
.
path_cost
);
return
(
scan_node
);
}
...
...
@@ -960,12 +948,13 @@ make_indexscan(List *qptlist,
List
*
qpqual
,
Index
scanrelid
,
List
*
indxid
,
List
*
indxqual
)
List
*
indxqual
,
Cost
cost
)
{
IndexScan
*
node
=
makeNode
(
IndexScan
);
Plan
*
plan
=
&
node
->
scan
.
plan
;
plan
->
cost
=
0
.
0
;
plan
->
cost
=
cost
;
plan
->
state
=
(
EState
*
)
NULL
;
plan
->
targetlist
=
qptlist
;
plan
->
qual
=
qpqual
;
...
...
@@ -1117,11 +1106,11 @@ make_material(List *tlist,
}
Agg
*
make_agg
(
List
*
tlist
,
int
nagg
,
Aggreg
**
aggs
)
make_agg
(
List
*
tlist
,
int
nagg
,
Aggreg
**
aggs
,
Plan
*
lefttree
)
{
Agg
*
node
=
makeNode
(
Agg
);
node
->
plan
.
cost
=
0
.
0
;
node
->
plan
.
cost
=
(
lefttree
?
lefttree
->
cost
:
0
)
;
node
->
plan
.
state
=
(
EState
*
)
NULL
;
node
->
plan
.
qual
=
NULL
;
node
->
plan
.
targetlist
=
tlist
;
...
...
src/include/optimizer/planmain.h
View file @
d3f0e87d
...
...
@@ -6,7 +6,7 @@
*
* Copyright (c) 1994, Regents of the University of California
*
* $Id: planmain.h,v 1.
6 1997/11/26 01:13:48
momjian Exp $
* $Id: planmain.h,v 1.
7 1997/12/18 12:21:02
momjian Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -21,8 +21,7 @@
/*
* prototypes for plan/planmain.c
*/
extern
Plan
*
query_planner
(
Query
*
root
,
extern
Plan
*
query_planner
(
Query
*
root
,
int
command_type
,
List
*
tlist
,
List
*
qual
);
...
...
@@ -30,15 +29,12 @@ query_planner(Query *root,
* prototypes for plan/createplan.c
*/
extern
Plan
*
create_plan
(
Path
*
best_path
);
extern
SeqScan
*
make_seqscan
(
List
*
qptlist
,
List
*
qpqual
,
Index
scanrelid
,
extern
SeqScan
*
make_seqscan
(
List
*
qptlist
,
List
*
qpqual
,
Index
scanrelid
,
Plan
*
lefttree
);
extern
Sort
*
make_sort
(
List
*
tlist
,
Oid
tempid
,
Plan
*
lefttree
,
extern
Sort
*
make_sort
(
List
*
tlist
,
Oid
tempid
,
Plan
*
lefttree
,
int
keycount
);
extern
Agg
*
make_agg
(
List
*
tlist
,
int
nagg
,
Aggreg
**
aggs
);
extern
Group
*
make_group
(
List
*
tlist
,
bool
tuplePerGroup
,
int
ngrp
,
extern
Agg
*
make_agg
(
List
*
tlist
,
int
nagg
,
Aggreg
**
aggs
,
Plan
*
lefttree
);
extern
Group
*
make_group
(
List
*
tlist
,
bool
tuplePerGroup
,
int
ngrp
,
AttrNumber
*
grpColIdx
,
Sort
*
lefttree
);
extern
Unique
*
make_unique
(
List
*
tlist
,
Plan
*
lefttree
,
char
*
uniqueAttr
);
extern
List
*
generate_fjoin
(
List
*
tlist
);
...
...
@@ -56,11 +52,9 @@ extern void add_missing_vars_to_base_rels(Query *root, List *tlist);
* prototypes for plan/setrefs.c
*/
extern
void
set_tlist_references
(
Plan
*
plan
);
extern
List
*
join_references
(
List
*
clauses
,
List
*
outer_tlist
,
extern
List
*
join_references
(
List
*
clauses
,
List
*
outer_tlist
,
List
*
inner_tlist
);
extern
List
*
index_outerjoin_references
(
List
*
inner_indxqual
,
extern
List
*
index_outerjoin_references
(
List
*
inner_indxqual
,
List
*
outer_tlist
,
Index
inner_relid
);
extern
void
set_result_tlist_references
(
Result
*
resultNode
);
extern
void
set_agg_tlist_references
(
Agg
*
aggNode
);
...
...
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