Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Gpdb
提交
cd280c84
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,发现更多精彩内容 >>
提交
cd280c84
编写于
1月 07, 2016
作者:
H
Heikki Linnakangas
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Whitespace cleanup, to reduce diff vs upstream.
上级
a2cc58e2
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
21 addition
and
23 deletion
+21
-23
src/backend/optimizer/plan/planner.c
src/backend/optimizer/plan/planner.c
+21
-23
未找到文件。
src/backend/optimizer/plan/planner.c
浏览文件 @
cd280c84
...
...
@@ -64,14 +64,15 @@ planner_hook_type planner_hook = NULL;
ParamListInfo
PlannerBoundParamList
=
NULL
;
/* current boundParams */
/* Expression kind codes for preprocess_expression */
#define EXPRKIND_QUAL 0
#define EXPRKIND_TARGET 1
#define EXPRKIND_RTFUNC 2
#define EXPRKIND_VALUES 3
#define EXPRKIND_LIMIT 4
#define EXPRKIND_ININFO 5
#define EXPRKIND_APPINFO 6
#define EXPRKIND_WINDOW_BOUND 7
#define EXPRKIND_QUAL 0
#define EXPRKIND_TARGET 1
#define EXPRKIND_RTFUNC 2
#define EXPRKIND_VALUES 3
#define EXPRKIND_LIMIT 4
#define EXPRKIND_ININFO 5
#define EXPRKIND_APPINFO 6
#define EXPRKIND_WINDOW_BOUND 7
static
Node
*
preprocess_expression
(
PlannerInfo
*
root
,
Node
*
expr
,
int
kind
);
static
void
preprocess_qual_conditions
(
PlannerInfo
*
root
,
Node
*
jtnode
);
...
...
@@ -237,7 +238,7 @@ optimize_query(Query *parse, ParamListInfo boundParams)
*
*****************************************************************************/
PlannedStmt
*
PlannedStmt
*
planner
(
Query
*
parse
,
int
cursorOptions
,
ParamListInfo
boundParams
)
{
...
...
@@ -324,7 +325,7 @@ standard_planner(Query *parse, int cursorOptions, ParamListInfo boundParams)
isCursor
=
true
;
cursorOptions
|=
((
DeclareCursorStmt
*
)
parse
->
utilityStmt
)
->
options
;
}
/*
* The planner can be called recursively (an example is when
* eval_const_expressions tries to pre-evaluate an SQL function).
...
...
@@ -335,7 +336,7 @@ standard_planner(Query *parse, int cursorOptions, ParamListInfo boundParams)
* PlannerInfo.
*/
glob
=
makeNode
(
PlannerGlobal
);
glob
->
boundParams
=
boundParams
;
glob
->
paramlist
=
NIL
;
glob
->
subplans
=
NIL
;
...
...
@@ -383,7 +384,7 @@ standard_planner(Query *parse, int cursorOptions, ParamListInfo boundParams)
/* Default assumption is we need all the tuples */
tuple_fraction
=
0
.
0
;
}
parse
=
normalize_query
(
parse
);
PlannerConfig
*
config
=
DefaultPlannerConfig
();
...
...
@@ -556,13 +557,13 @@ subquery_planner(PlannerGlobal *glob,
root
->
parent_root
=
parent_root
;
root
->
planner_cxt
=
CurrentMemoryContext
;
root
->
init_plans
=
NIL
;
root
->
list_cteplaninfo
=
NIL
;
if
(
parse
->
cteList
!=
NIL
)
{
root
->
list_cteplaninfo
=
init_list_cteplaninfo
(
list_length
(
parse
->
cteList
));
}
root
->
in_info_list
=
NIL
;
root
->
append_rel_list
=
NIL
;
...
...
@@ -578,7 +579,6 @@ subquery_planner(PlannerGlobal *glob,
/* Ensure that jointree has been normalized. See normalize_query_jointree_mutator() */
AssertImply
(
parse
->
jointree
->
fromlist
,
list_length
(
parse
->
jointree
->
fromlist
)
==
1
);
/* CDB: Stash current query level's relids before pulling up subqueries. */
root
->
currlevel_relids
=
get_relids_in_jointree
((
Node
*
)
parse
->
jointree
);
...
...
@@ -591,7 +591,6 @@ subquery_planner(PlannerGlobal *glob,
if
(
parse
->
hasSubLinks
)
cdbsubselect_flatten_sublinks
(
root
,
(
Node
*
)
parse
);
/*
* Check to see if any subqueries in the rangetable can be merged into
* this query.
...
...
@@ -838,7 +837,6 @@ subquery_planner(PlannerGlobal *glob,
*/
if
(
list_length
(
glob
->
subplans
)
!=
num_old_subplans
||
root
->
query_level
>
1
)
{
Assert
(
root
->
parse
==
parse
);
/* GPDP isn't always careful about this. */
SS_finalize_plan
(
root
,
root
->
parse
->
rtable
,
plan
,
true
);
...
...
@@ -847,7 +845,7 @@ subquery_planner(PlannerGlobal *glob,
/* Return internal info if caller wants it */
if
(
subroot
)
*
subroot
=
root
;
return
plan
;
}
...
...
@@ -1066,7 +1064,7 @@ inheritance_planner(PlannerInfo *root)
*/
if
(
is_dummy_plan
(
subplan
))
continue
;
/* MPP needs target loci to match. */
if
(
Gp_role
==
GP_ROLE_DISPATCH
)
{
...
...
@@ -2017,7 +2015,7 @@ grouping_planner(PlannerInfo *root, double tuple_fraction)
}
}
/*
/*
* If we were not able to make the plan come out in the right order, add
* an explicit sort step. Note that, if we going to add a Unique node,
* the sort_pathkeys will have the distinct keys as a prefix.
...
...
@@ -2106,7 +2104,7 @@ grouping_planner(PlannerInfo *root, double tuple_fraction)
rlist
=
set_returning_clause_references
(
root
->
glob
,
parse
->
returningList
,
result_plan
,
parse
->
resultRelation
);
parse
->
resultRelation
);
root
->
returningLists
=
list_make1
(
rlist
);
}
else
...
...
@@ -2152,11 +2150,11 @@ is_dummy_plan_walker(Node *node, bool *context)
*/
if
(
node
==
NULL
||
!
is_plan_node
(
node
)
)
return
false
;
switch
(
nodeTag
(
node
))
{
case
T_Result
:
/*
/*
* This tests the base case of a dummy plan which is a Result
* node with a constant FALSE filter quals. (This is the case
* constructed as an empty Append path by set_plain_rel_pathlist
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录