Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Metz
oceanbase
提交
90c6bd30
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,发现更多精彩内容 >>
提交
90c6bd30
编写于
6月 30, 2022
作者:
C
Charles0429
提交者:
linzhigang.lzg
7月 04, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[CP] fix create global index performace
上级
2146f1d1
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
10 addition
and
4 deletion
+10
-4
src/rootserver/ob_global_index_builder.cpp
src/rootserver/ob_global_index_builder.cpp
+9
-1
src/sql/ob_index_sstable_builder.cpp
src/sql/ob_index_sstable_builder.cpp
+1
-3
未找到文件。
src/rootserver/ob_global_index_builder.cpp
浏览文件 @
90c6bd30
...
...
@@ -1272,6 +1272,7 @@ int ObGlobalIndexBuilder::do_build_single_replica(
ObGlobalIndexTask
*
task
,
const
share
::
schema
::
ObTableSchema
*
index_schema
,
const
int64_t
snapshot
)
{
int
ret
=
OB_SUCCESS
;
const
ObTableSchema
*
table_schema
=
nullptr
;
ObRootService
*
root_service
=
NULL
;
if
(
OB_UNLIKELY
(
!
inited_
))
{
ret
=
OB_NOT_INIT
;
...
...
@@ -1284,12 +1285,19 @@ int ObGlobalIndexBuilder::do_build_single_replica(
LOG_WARN
(
"root service ptr is null"
,
K
(
ret
));
}
else
{
sql
::
ObIndexSSTableBuilder
::
BuildIndexJob
job
;
int64_t
parallel_server_target
=
5
;
int
tmp_ret
=
OB_SUCCESS
;
job
.
job_id_
=
index_schema
->
get_table_id
();
job
.
schema_version_
=
task
->
schema_version_
;
job
.
snapshot_version_
=
snapshot
;
job
.
data_table_id_
=
index_schema
->
get_data_table_id
();
job
.
index_table_id_
=
index_schema
->
get_table_id
();
job
.
degree_of_parallelism_
=
10
;
if
(
OB_UNLIKELY
(
OB_SUCCESS
!=
(
tmp_ret
=
ObSchemaUtils
::
get_tenant_int_variable
(
OB_SYS_TENANT_ID
,
SYS_VAR_PARALLEL_SERVERS_TARGET
,
parallel_server_target
))))
{
STORAGE_LOG
(
WARN
,
"failed to get sys tenant parallel server target"
,
K
(
tmp_ret
));
}
job
.
degree_of_parallelism_
=
std
::
max
(
10L
,
parallel_server_target
*
2
);
job
.
degree_of_parallelism_
=
std
::
min
(
96L
,
job
.
degree_of_parallelism_
);
const
int64_t
timeout
=
GCONF
.
global_index_build_single_replica_timeout
;
const
int64_t
abs_timeout_us
=
ObTimeUtility
::
current_time
()
+
timeout
;
if
(
OB_FAIL
(
root_service
->
submit_index_sstable_build_task
(
job
,
*
this
,
abs_timeout_us
)))
{
...
...
src/sql/ob_index_sstable_builder.cpp
浏览文件 @
90c6bd30
...
...
@@ -1632,7 +1632,7 @@ int ObIndexSSTableBuilder::split_ranges(ObArray<ObArray<ObNewRange>>& ranges_arr
"SELECT %.*s FROM "
"(SELECT %.*s, bucket, ROW_NUMBER() OVER (PARTITION BY bucket ORDER BY %.*s) rn FROM "
"(SELECT %.*s, NTILE(%ld) OVER (ORDER BY %.*s) bucket FROM "
"(SELECT %.*s FROM %s%.*s%s.%s%.*s%s SAMPLE BLOCK(%g)
%s %ld
) a) b) c WHERE rn = 1 "
"(SELECT %.*s FROM %s%.*s%s.%s%.*s%s SAMPLE BLOCK(%g)) a) b) c WHERE rn = 1 "
"GROUP BY %.*s ORDER BY %.*s"
,
static_cast
<
int
>
(
col_alias
.
length
()),
col_alias
.
ptr
(),
...
...
@@ -1659,8 +1659,6 @@ int ObIndexSSTableBuilder::split_ranges(ObArray<ObArray<ObNewRange>>& ranges_arr
sample_table
.
get_table_name_str
().
ptr
(),
name_quote
(),
sample_pct
,
oracle_mode_
?
"WHERE ROWNUM <="
:
"LIMIT"
,
max_sample_rows
*
2
,
static_cast
<
int
>
(
col_alias
.
length
()),
col_alias
.
ptr
(),
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录