Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Metz
oceanbase
提交
4942b97c
O
oceanbase
项目概览
Metz
/
oceanbase
与 Fork 源项目一致
Fork自
oceanbase / oceanbase
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
O
oceanbase
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
4942b97c
编写于
7月 31, 2022
作者:
O
obdev
提交者:
wangzelin.wzl
7月 31, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[CP] fix allocate gi above window function bug
上级
f3f54ca0
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
27 addition
and
5 deletion
+27
-5
src/sql/optimizer/ob_log_group_by.cpp
src/sql/optimizer/ob_log_group_by.cpp
+25
-4
src/sql/optimizer/ob_log_group_by.h
src/sql/optimizer/ob_log_group_by.h
+1
-0
src/sql/optimizer/ob_log_window_function.h
src/sql/optimizer/ob_log_window_function.h
+1
-1
未找到文件。
src/sql/optimizer/ob_log_group_by.cpp
浏览文件 @
4942b97c
...
...
@@ -27,6 +27,7 @@
#include "ob_raw_expr_push_down_aggr_expr.h"
#include "ob_select_log_plan.h"
#include "common/ob_smart_call.h"
#include "ob_log_window_function.h"
using
namespace
oceanbase
;
using
namespace
sql
;
...
...
@@ -277,15 +278,15 @@ int ObLogGroupBy::allocate_groupby_below(const ObIArray<ObRawExpr*>& distinct_ex
// 2. distint expr is pushed down, such as count(distinct c1)
// a partition should not be processed by two px tasks, other the distinct result
// will be mis-estimated
bool
find_exchange
=
fals
e
;
bool
child_can_pullup_gi
=
tru
e
;
if
(
OB_ISNULL
(
child
=
child_group_by
->
get_child
(
first_child
)))
{
ret
=
OB_ERR_UNEXPECTED
;
LOG_WARN
(
"get unexpected null"
,
K
(
child
),
K
(
ret
));
}
else
if
(
OB_FAIL
(
child_group_by
->
get_sharding_info
().
copy_with_part_keys
(
child
->
get_sharding_info
())))
{
LOG_WARN
(
"failed to copy sharding info"
,
K
(
ret
));
}
else
if
(
OB_FAIL
(
ch
ild_has_exchange
(
child
,
find_exchange
)))
{
}
else
if
(
OB_FAIL
(
ch
eck_can_pullup_gi
(
child
,
child_can_pullup_gi
)))
{
LOG_WARN
(
"fail to find tsc recursive"
);
}
else
if
(
!
find_exchange
)
{
}
else
if
(
child_can_pullup_gi
)
{
child_group_by
->
set_is_partition_wise
(
true
);
child_group_by
->
set_is_block_gi_allowed
(
!
should_push_distinct
);
}
else
{
/*do nothing*/
...
...
@@ -306,7 +307,27 @@ int ObLogGroupBy::allocate_groupby_below(const ObIArray<ObRawExpr*>& distinct_ex
return
ret
;
}
int
ObLogGroupBy
::
get_group_rollup_exprs
(
common
::
ObIArray
<
ObRawExpr
*>&
group_rollup_exprs
)
const
// child has allocate exchange or parallel window function, can not pullup gi
int
ObLogGroupBy
::
check_can_pullup_gi
(
const
ObLogicalOperator
*
op
,
bool
&
can_pullup
)
{
int
ret
=
OB_SUCCESS
;
if
(
OB_ISNULL
(
op
)
||
!
can_pullup
)
{
/*do nothing*/
}
else
if
(
log_op_def
::
LOG_EXCHANGE
==
op
->
get_type
()
||
(
log_op_def
::
LOG_WINDOW_FUNCTION
==
op
->
get_type
()
&&
static_cast
<
const
ObLogWindowFunction
*>
(
op
)
->
is_parallel
()))
{
can_pullup
=
false
;
}
else
{
for
(
int
i
=
0
;
OB_SUCC
(
ret
)
&&
can_pullup
&&
i
<
op
->
get_num_of_child
();
++
i
)
{
if
(
OB_FAIL
(
SMART_CALL
(
check_can_pullup_gi
(
op
->
get_child
(
i
),
can_pullup
))))
{
LOG_WARN
(
"fail to find tsc recursive"
,
K
(
ret
));
}
}
}
return
ret
;
}
int
ObLogGroupBy
::
get_group_rollup_exprs
(
common
::
ObIArray
<
ObRawExpr
*>
&
group_rollup_exprs
)
const
{
int
ret
=
OB_SUCCESS
;
if
(
OB_FAIL
(
append
(
group_rollup_exprs
,
group_exprs_
)))
{
...
...
src/sql/optimizer/ob_log_group_by.h
浏览文件 @
4942b97c
...
...
@@ -95,6 +95,7 @@ public:
int
allocate_groupby_below
(
const
ObIArray
<
ObRawExpr
*>&
distinct_exprs
,
const
bool
can_push
,
ObLogicalOperator
*&
exchange_point
,
common
::
ObIArray
<
std
::
pair
<
ObRawExpr
*
,
ObRawExpr
*>
>&
group_push_down_replaced_exprs
);
int
check_can_pullup_gi
(
const
ObLogicalOperator
*
op
,
bool
&
can_pullup
);
int
should_push_down_group_by
(
AllocExchContext
&
ctx
,
ObIArray
<
ObRawExpr
*>&
distinct_exprs
,
bool
&
should_push_groupby
,
bool
&
should_push_distinct
);
virtual
uint64_t
hash
(
uint64_t
seed
)
const
override
;
...
...
src/sql/optimizer/ob_log_window_function.h
浏览文件 @
4942b97c
...
...
@@ -46,7 +46,7 @@ public:
virtual
int
allocate_granule_pre
(
AllocGIContext
&
ctx
)
override
;
int
get_win_partition_intersect_exprs
(
ObIArray
<
ObWinFunRawExpr
*>&
win_exprs
,
ObIArray
<
ObRawExpr
*>&
win_part_exprs
);
virtual
int
inner_append_not_produced_exprs
(
ObRawExprUniqueSet
&
raw_exprs
)
const
override
;
bool
is_parallel
()
bool
is_parallel
()
const
{
return
is_parallel_
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录