Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Metz
oceanbase
提交
6718bd64
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看板
提交
6718bd64
编写于
8月 24, 2021
作者:
Y
yht0
提交者:
wangzelin.wzl
8月 24, 2021
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix estimating row incorrectly after several minor freeze
上级
dde5e025
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
9 addition
and
10 deletion
+9
-10
src/storage/blocksstable/ob_micro_block_index_mgr.cpp
src/storage/blocksstable/ob_micro_block_index_mgr.cpp
+6
-6
src/storage/ob_sstable_estimator.cpp
src/storage/ob_sstable_estimator.cpp
+3
-4
未找到文件。
src/storage/blocksstable/ob_micro_block_index_mgr.cpp
浏览文件 @
6718bd64
...
...
@@ -334,7 +334,6 @@ int ObMicroBlockIndexMgr::cal_border_row_count(const ObStoreRange& range, const
logical_row_count
+=
(
row_count_delta_
*
count
)
/
micro_count_
;
physical_row_count
+=
(
row_count_
*
count
)
/
micro_count_
;
if
(
row_count_delta_
<=
0
)
{
const
int64_t
gap_ratio
=
1
+
(
row_count_delta_
<
0
);
const
int32_t
avg_micro_row_count
=
row_count_
/
micro_count_
;
int64_t
index
=
start
-
index_array_
;
const
int64_t
end_index
=
end
-
index_array_
;
...
...
@@ -344,14 +343,15 @@ int ObMicroBlockIndexMgr::cal_border_row_count(const ObStoreRange& range, const
gap_size
+=
avg_micro_row_count
;
}
else
{
if
(
gap_size
>=
common
::
OB_SKIP_RANGE_LIMIT
)
{
physical_row_count
-=
gap_size
*
gap_ratio
;
physical_row_count
-=
gap_size
;
}
gap_size
=
0
;
}
}
if
(
gap_size
>=
common
::
OB_SKIP_RANGE_LIMIT
)
{
physical_row_count
-=
gap_size
*
gap_ratio
;
physical_row_count
-=
gap_size
;
}
physical_row_count
+=
row_count_delta_
;
}
}
return
ret
;
...
...
@@ -366,7 +366,6 @@ int ObMicroBlockIndexMgr::cal_macro_purged_row_count(int64_t& purged_row_count)
}
else
if
(
NULL
==
mark_deletion_array_
)
{
}
else
{
const
int64_t
avg_micro_row_count
=
row_count_
/
micro_count_
;
const
int64_t
gap_ratio
=
1
+
(
row_count_delta_
<
0
);
int64_t
gap_size
=
0
;
purged_row_count
=
0
;
for
(
int
i
=
0
;
OB_SUCC
(
ret
)
&&
i
<
micro_count_
;
++
i
)
{
...
...
@@ -374,14 +373,15 @@ int ObMicroBlockIndexMgr::cal_macro_purged_row_count(int64_t& purged_row_count)
gap_size
+=
avg_micro_row_count
;
}
else
{
if
(
gap_size
>=
common
::
OB_SKIP_RANGE_LIMIT
)
{
purged_row_count
+=
gap_size
*
gap_ratio
;
purged_row_count
+=
gap_size
;
}
gap_size
=
0
;
}
}
if
(
gap_size
>=
common
::
OB_SKIP_RANGE_LIMIT
)
{
purged_row_count
+=
gap_size
*
gap_ratio
;
purged_row_count
+=
gap_size
;
}
purged_row_count
-=
(
row_count_delta_
<
0
?
row_count_delta_
:
0
);
}
return
ret
;
}
...
...
src/storage/ob_sstable_estimator.cpp
浏览文件 @
6718bd64
...
...
@@ -589,9 +589,8 @@ int ObMultiVersionSingleScanEstimator::estimate_macro_row_count(const blocksstab
}
else
{
const
int64_t
delta
=
meta
.
meta_
->
row_count_delta_
;
// if delta < 0, it means this macro block really delete rows already exist in older table
// so we should minus gap_size * 2 from physical row count since rows from older table can
// be skipped
const
int64_t
gap_ratio
=
1
+
(
delta
<
0
);
// so if this delta is believable, we should minus gap_size+delta from physical row count
// since rows from older table can be skipped
int64_t
macro_purged_row_count
=
0
;
bool
need_reset_gap
=
false
;
if
(
!
(
is_left_border
||
is_right_border
))
{
...
...
@@ -599,7 +598,7 @@ int ObMultiVersionSingleScanEstimator::estimate_macro_row_count(const blocksstab
part_est
.
physical_row_count_
+=
meta
.
meta_
->
row_count_
;
if
(
meta
.
meta_
->
macro_block_deletion_flag_
)
{
gap_size
+=
meta
.
meta_
->
row_count_
;
purged_phy_row_count
+=
meta
.
meta_
->
row_count_
*
gap_ratio
;
purged_phy_row_count
+=
meta
.
meta_
->
row_count_
-
(
delta
<
0
?
delta
:
0
)
;
}
else
{
need_reset_gap
=
true
;
if
(
delta
<=
0
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录