Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Gpdb
提交
fecb2b00
G
Gpdb
项目概览
Greenplum
/
Gpdb
通知
7
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
G
Gpdb
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
fecb2b00
编写于
5月 16, 1999
作者:
T
Tom Lane
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Minor code cleanup in optimizer.
上级
f2ed835b
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
16 addition
and
29 deletion
+16
-29
src/backend/optimizer/path/clausesel.c
src/backend/optimizer/path/clausesel.c
+3
-3
src/backend/optimizer/path/joinpath.c
src/backend/optimizer/path/joinpath.c
+10
-18
src/include/optimizer/internal.h
src/include/optimizer/internal.h
+3
-8
未找到文件。
src/backend/optimizer/path/clausesel.c
浏览文件 @
fecb2b00
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/clausesel.c,v 1.1
8 1999/02/15 01:06:5
7 tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/clausesel.c,v 1.1
9 1999/05/16 19:45:3
7 tgl Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -53,7 +53,7 @@ set_clause_selectivities(List *restrictinfo_list, Cost new_selectivity)
...
@@ -53,7 +53,7 @@ set_clause_selectivities(List *restrictinfo_list, Cost new_selectivity)
{
{
clausenode
=
(
RestrictInfo
*
)
lfirst
(
temp
);
clausenode
=
(
RestrictInfo
*
)
lfirst
(
temp
);
cost_clause
=
clausenode
->
selectivity
;
cost_clause
=
clausenode
->
selectivity
;
if
(
FLOAT_IS_ZERO
(
cost_clause
)
||
new_selectivity
<
cost_clause
)
if
(
cost_clause
<=
0
||
new_selectivity
<
cost_clause
)
clausenode
->
selectivity
=
new_selectivity
;
clausenode
->
selectivity
=
new_selectivity
;
}
}
}
}
...
@@ -129,7 +129,7 @@ set_rest_selec(Query *root, List *restrictinfo_list)
...
@@ -129,7 +129,7 @@ set_rest_selec(Query *root, List *restrictinfo_list)
* Check to see if the selectivity of this clause or any 'or'
* Check to see if the selectivity of this clause or any 'or'
* subclauses (if any) haven't been set yet.
* subclauses (if any) haven't been set yet.
*/
*/
if
(
valid_or_clause
(
clausenode
)
||
FLOAT_IS_ZERO
(
cost_claus
e
))
if
(
cost_clause
<=
0
||
valid_or_clause
(
clausenod
e
))
{
{
clausenode
->
selectivity
=
compute_clause_selec
(
root
,
clausenode
->
selectivity
=
compute_clause_selec
(
root
,
(
Node
*
)
clausenode
->
clause
,
(
Node
*
)
clausenode
->
clause
,
...
...
src/backend/optimizer/path/joinpath.c
浏览文件 @
fecb2b00
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/joinpath.c,v 1.3
4 1999/05/01 19:47:42
tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/joinpath.c,v 1.3
5 1999/05/16 19:45:37
tgl Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -418,29 +418,21 @@ match_unsorted_inner(RelOptInfo *joinrel,
...
@@ -418,29 +418,21 @@ match_unsorted_inner(RelOptInfo *joinrel,
List
*
innerpath_list
,
List
*
innerpath_list
,
List
*
mergeinfo_list
)
List
*
mergeinfo_list
)
{
{
Path
*
innerpath
=
(
Path
*
)
NULL
;
List
*
mp_list
=
NIL
;
List
*
mp_list
=
NIL
;
PathOrder
*
innerpath_ordering
=
NULL
;
List
*
i
;
Cost
temp1
=
0
.
0
;
bool
temp2
=
false
;
List
*
i
=
NIL
;
foreach
(
i
,
innerpath_list
)
foreach
(
i
,
innerpath_list
)
{
{
Path
*
innerpath
=
(
Path
*
)
lfirst
(
i
);
PathOrder
*
innerpath_ordering
=
innerpath
->
pathorder
;
MergeInfo
*
xmergeinfo
=
(
MergeInfo
*
)
NULL
;
MergeInfo
*
xmergeinfo
=
(
MergeInfo
*
)
NULL
;
List
*
clauses
=
NIL
;
List
*
clauses
=
NIL
;
List
*
matchedJoinKeys
=
NIL
;
List
*
matchedJoinKeys
=
NIL
;
List
*
matchedJoinClauses
=
NIL
;
List
*
matchedJoinClauses
=
NIL
;
innerpath
=
(
Path
*
)
lfirst
(
i
);
innerpath_ordering
=
innerpath
->
pathorder
;
if
(
innerpath_ordering
)
if
(
innerpath_ordering
)
{
xmergeinfo
=
match_order_mergeinfo
(
innerpath_ordering
,
xmergeinfo
=
match_order_mergeinfo
(
innerpath_ordering
,
mergeinfo_list
);
mergeinfo_list
);
}
if
(
xmergeinfo
)
if
(
xmergeinfo
)
clauses
=
((
JoinMethod
*
)
xmergeinfo
)
->
clauses
;
clauses
=
((
JoinMethod
*
)
xmergeinfo
)
->
clauses
;
...
@@ -463,13 +455,13 @@ match_unsorted_inner(RelOptInfo *joinrel,
...
@@ -463,13 +455,13 @@ match_unsorted_inner(RelOptInfo *joinrel,
*/
*/
if
(
clauses
&&
matchedJoinKeys
)
if
(
clauses
&&
matchedJoinKeys
)
{
{
Cost
temp1
;
temp1
=
outerrel
->
cheapestpath
->
path_cost
+
temp1
=
outerrel
->
cheapestpath
->
path_cost
+
cost_sort
(
matchedJoinKeys
,
outerrel
->
size
,
outerrel
->
width
);
cost_sort
(
matchedJoinKeys
,
outerrel
->
size
,
outerrel
->
width
);
temp2
=
(
bool
)
(
FLOAT_IS_ZERO
(
innerpath
->
outerjoincost
)
if
(
innerpath
->
outerjoincost
<=
0
/* unset? */
||
(
innerpath
->
outerjoincost
>
temp1
));
||
innerpath
->
outerjoincost
>
temp1
)
if
(
temp2
)
{
{
List
*
outerkeys
=
make_pathkeys_from_joinkeys
(
matchedJoinKeys
,
List
*
outerkeys
=
make_pathkeys_from_joinkeys
(
matchedJoinKeys
,
outerrel
->
targetlist
,
outerrel
->
targetlist
,
...
@@ -494,8 +486,8 @@ match_unsorted_inner(RelOptInfo *joinrel,
...
@@ -494,8 +486,8 @@ match_unsorted_inner(RelOptInfo *joinrel,
}
}
}
}
}
}
return
mp_list
;
return
mp_list
;
}
}
static
bool
static
bool
...
...
src/include/optimizer/internal.h
浏览文件 @
fecb2b00
...
@@ -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: internal.h,v 1.1
8 1999/03/07 12:00:38 momjian
Exp $
* $Id: internal.h,v 1.1
9 1999/05/16 19:45:36 tgl
Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -27,7 +27,7 @@
...
@@ -27,7 +27,7 @@
* System-dependent tuning constants
* System-dependent tuning constants
*
*
*/
*/
#define _CPU_PAGE_WEIGHT_ 0.033
/* CPU-heap-to-page cost weighting factor */
#define _CPU_PAGE_WEIGHT_ 0.033
/* CPU-heap-to-page cost weighting factor */
#define _CPU_INDEX_PAGE_WEIGHT_ 0.017
/* CPU-index-to-page cost
#define _CPU_INDEX_PAGE_WEIGHT_ 0.017
/* CPU-index-to-page cost
* weighting factor */
* weighting factor */
#define _MAX_KEYS_ INDEX_MAX_KEYS
/* maximum number of keys in an
#define _MAX_KEYS_ INDEX_MAX_KEYS
/* maximum number of keys in an
...
@@ -64,7 +64,7 @@
...
@@ -64,7 +64,7 @@
/* Identifier for invalid relation OIDs and attribute numbers for use by
/* Identifier for invalid relation OIDs and attribute numbers for use by
* selectivity functions
* selectivity functions
*/
*/
#define _SELEC_VALUE_UNKNOWN_
-1
#define _SELEC_VALUE_UNKNOWN_
(-1)
/* Flag indicating that a clause constant is really a parameter (or other
/* Flag indicating that a clause constant is really a parameter (or other
* non-constant?), a non-parameter, or a constant on the right side
* non-constant?), a non-parameter, or a constant on the right side
...
@@ -75,11 +75,6 @@
...
@@ -75,11 +75,6 @@
#define _SELEC_CONSTANT_LEFT_ 0
#define _SELEC_CONSTANT_LEFT_ 0
#define _SELEC_CONSTANT_RIGHT_ 2
#define _SELEC_CONSTANT_RIGHT_ 2
#define TOLERANCE 0.000001
#define FLOAT_EQUAL(X,Y) ((X) - (Y) < TOLERANCE)
#define FLOAT_IS_ZERO(X) (FLOAT_EQUAL(X,0.0))
/* #define deactivate_joininfo(joininfo) joininfo->inactive=true*/
/* #define deactivate_joininfo(joininfo) joininfo->inactive=true*/
/*#define joininfo_inactive(joininfo) joininfo->inactive */
/*#define joininfo_inactive(joininfo) joininfo->inactive */
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录