Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
2f4bcd26
TDengine
项目概览
taosdata
/
TDengine
12 个月 前同步成功
通知
1180
Star
22014
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
2f4bcd26
编写于
6月 18, 2022
作者:
H
Haojun Liao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
enh(query): add more info about tablescan.
上级
956173e2
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
47 addition
and
15 deletion
+47
-15
source/libs/command/src/explain.c
source/libs/command/src/explain.c
+43
-12
source/libs/executor/src/scanoperator.c
source/libs/executor/src/scanoperator.c
+4
-3
未找到文件。
source/libs/command/src/explain.c
浏览文件 @
2f4bcd26
...
...
@@ -412,6 +412,7 @@ int32_t qExplainResNodeToRowsImpl(SExplainResNode *pResNode, SExplainCtx *ctx, i
QRY_ERR_RET
(
qExplainBufAppendExecInfo
(
pResNode
->
pExecInfo
,
tbuf
,
&
tlen
));
EXPLAIN_ROW_APPEND
(
EXPLAIN_BLANK_FORMAT
);
}
EXPLAIN_ROW_APPEND
(
EXPLAIN_COLUMNS_FORMAT
,
pTblScanNode
->
scan
.
pScanCols
->
length
);
EXPLAIN_ROW_APPEND
(
EXPLAIN_BLANK_FORMAT
);
EXPLAIN_ROW_APPEND
(
EXPLAIN_WIDTH_FORMAT
,
pTblScanNode
->
scan
.
node
.
pOutputDataBlockDesc
->
totalRowSize
);
...
...
@@ -426,27 +427,57 @@ int32_t qExplainResNodeToRowsImpl(SExplainResNode *pResNode, SExplainCtx *ctx, i
EXPLAIN_ROW_NEW
(
level
+
1
,
"I/O: "
);
int32_t
nodeNum
=
taosArrayGetSize
(
pResNode
->
pExecInfo
);
for
(
int32_t
i
=
0
;
i
<
nodeNum
;
++
i
)
{
struct
STableScanAnalyzeInfo
info
=
{
0
};
int32_t
maxIndex
=
0
;
int32_t
totalRows
=
0
;
for
(
int32_t
i
=
0
;
i
<
nodeNum
;
++
i
)
{
SExplainExecInfo
*
execInfo
=
taosArrayGet
(
pResNode
->
pExecInfo
,
i
);
STableScanAnalyzeInfo
*
pScanInfo
=
(
STableScanAnalyzeInfo
*
)
execInfo
->
verboseInfo
;
EXPLAIN_ROW_APPEND
(
"total_blocks=%d"
,
pScanInfo
->
totalBlocks
);
EXPLAIN_ROW_APPEND
(
EXPLAIN_BLANK_FORMAT
);
info
.
totalBlocks
+=
pScanInfo
->
totalBlocks
;
info
.
loadBlocks
+=
pScanInfo
->
loadBlocks
;
info
.
totalRows
+=
pScanInfo
->
totalRows
;
info
.
skipBlocks
+=
pScanInfo
->
skipBlocks
;
info
.
filterTime
+=
pScanInfo
->
filterTime
;
info
.
loadBlockStatis
+=
pScanInfo
->
loadBlockStatis
;
info
.
totalCheckedRows
+=
pScanInfo
->
totalCheckedRows
;
info
.
filterOutBlocks
+=
pScanInfo
->
filterOutBlocks
;
if
(
pScanInfo
->
totalRows
>
totalRows
)
{
totalRows
=
pScanInfo
->
totalRows
;
maxIndex
=
i
;
}
}
EXPLAIN_ROW_APPEND
(
"load_blocks=%d"
,
pScanInfo
->
loadBlocks
);
EXPLAIN_ROW_APPEND
(
EXPLAIN_BLANK_FORMAT
);
EXPLAIN_ROW_APPEND
(
"total_blocks=%.1f"
,
((
double
)
info
.
totalBlocks
)
/
nodeNum
);
EXPLAIN_ROW_APPEND
(
EXPLAIN_BLANK_FORMAT
);
EXPLAIN_ROW_APPEND
(
"load_block_SMAs=%d"
,
pScanInfo
->
loadBlockStatis
);
EXPLAIN_ROW_APPEND
(
EXPLAIN_BLANK_FORMAT
);
EXPLAIN_ROW_APPEND
(
"load_blocks=%.1f"
,
((
double
)
info
.
loadBlocks
)
/
nodeNum
);
EXPLAIN_ROW_APPEND
(
EXPLAIN_BLANK_FORMAT
);
EXPLAIN_ROW_APPEND
(
"total_rows=%"
PRIu64
,
pScanInfo
->
totalRows
);
EXPLAIN_ROW_APPEND
(
EXPLAIN_BLANK_FORMAT
);
EXPLAIN_ROW_APPEND
(
"load_block_SMAs=%.1f"
,
((
double
)
info
.
loadBlockStatis
)
/
nodeNum
);
EXPLAIN_ROW_APPEND
(
EXPLAIN_BLANK_FORMAT
);
EXPLAIN_ROW_APPEND
(
"check_rows=%"
PRIu64
,
pScanInfo
->
totalCheckedRows
);
EXPLAIN_ROW_APPEND
(
EXPLAIN_BLANK_FORMAT
);
}
EXPLAIN_ROW_APPEND
(
"total_rows=%.1f"
,
((
double
)
info
.
totalRows
)
/
nodeNum
);
EXPLAIN_ROW_APPEND
(
EXPLAIN_BLANK_FORMAT
);
EXPLAIN_ROW_APPEND
(
"check_rows=%.1f"
,
((
double
)
info
.
totalCheckedRows
)
/
nodeNum
);
EXPLAIN_ROW_APPEND
(
EXPLAIN_BLANK_FORMAT
);
EXPLAIN_ROW_END
();
QRY_ERR_RET
(
qExplainResAppendRow
(
ctx
,
tbuf
,
tlen
,
level
+
1
));
//Rows out: Avg 4166.7 rows x 24 workers. Max 4187 rows (seg7) with 0.220 ms to first row, 1.738 ms to end, start offset by 1.470 ms.
SExplainExecInfo
*
execInfo
=
taosArrayGet
(
pResNode
->
pExecInfo
,
maxIndex
);
STableScanAnalyzeInfo
*
p1
=
(
STableScanAnalyzeInfo
*
)
execInfo
->
verboseInfo
;
EXPLAIN_ROW_NEW
(
level
+
1
,
" "
);
EXPLAIN_ROW_APPEND
(
"max_row_task=%d, total_rows:%"
PRId64
", ep:%s (cost=%.3f..%.3f)"
,
maxIndex
,
p1
->
totalRows
,
"tbd"
,
execInfo
->
startupCost
,
execInfo
->
totalCost
);
EXPLAIN_ROW_APPEND
(
EXPLAIN_BLANK_FORMAT
);
EXPLAIN_ROW_END
();
QRY_ERR_RET
(
qExplainResAppendRow
(
ctx
,
tbuf
,
tlen
,
level
+
1
));
}
...
...
source/libs/executor/src/scanoperator.c
浏览文件 @
2f4bcd26
...
...
@@ -367,13 +367,14 @@ void setTbNameColData(void* pMeta, const SSDataBlock* pBlock, SColumnInfoData* p
static
SSDataBlock
*
doTableScanImpl
(
SOperatorInfo
*
pOperator
)
{
STableScanInfo
*
pTableScanInfo
=
pOperator
->
info
;
SExecTaskInfo
*
pTaskInfo
=
pOperator
->
pTaskInfo
;
SSDataBlock
*
pBlock
=
pTableScanInfo
->
pResBlock
;
int64_t
st
=
taosGetTimestampUs
();
while
(
tsdbNextDataBlock
(
pTableScanInfo
->
dataReader
))
{
if
(
isTaskKilled
(
p
Operator
->
p
TaskInfo
))
{
longjmp
(
p
Operator
->
p
TaskInfo
->
env
,
TSDB_CODE_TSC_QUERY_CANCELLED
);
if
(
isTaskKilled
(
pTaskInfo
))
{
longjmp
(
pTaskInfo
->
env
,
TSDB_CODE_TSC_QUERY_CANCELLED
);
}
// process this data block based on the probabilities
...
...
@@ -396,7 +397,7 @@ static SSDataBlock* doTableScanImpl(SOperatorInfo* pOperator) {
continue
;
}
uint64_t
*
groupId
=
taosHashGet
(
p
Operator
->
p
TaskInfo
->
tableqinfoList
.
map
,
&
pBlock
->
info
.
uid
,
sizeof
(
int64_t
));
uint64_t
*
groupId
=
taosHashGet
(
pTaskInfo
->
tableqinfoList
.
map
,
&
pBlock
->
info
.
uid
,
sizeof
(
int64_t
));
if
(
groupId
)
{
pBlock
->
info
.
groupId
=
*
groupId
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录