Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
027a0c11
T
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22016
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
027a0c11
编写于
9月 28, 2022
作者:
H
Haojun Liao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
refactor(query): do some internal refactor.
上级
14412f28
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
22 addition
and
18 deletion
+22
-18
source/client/src/clientEnv.c
source/client/src/clientEnv.c
+3
-2
source/client/src/clientImpl.c
source/client/src/clientImpl.c
+13
-14
source/client/src/clientMain.c
source/client/src/clientMain.c
+6
-2
未找到文件。
source/client/src/clientEnv.c
浏览文件 @
027a0c11
...
...
@@ -85,11 +85,12 @@ static void deregisterRequest(SRequestObj *pRequest) {
atomic_add_fetch_64
((
int64_t
*
)
&
pActivity
->
insertElapsedTime
,
duration
);
}
else
if
(
QUERY_NODE_SELECT_STMT
==
pRequest
->
stmtType
)
{
tscPerf
(
"select duration %"
PRId64
"us: syntax:%"
PRId64
"us, ctg:%"
PRId64
"us, semantic:%"
PRId64
"us, planner:%"
PRId64
"us, exec:%"
PRId64
"us
"
,
"us, planner:%"
PRId64
"us, exec:%"
PRId64
"us
, reqId:0x%"
PRIx64
,
duration
,
pRequest
->
metric
.
syntaxEnd
-
pRequest
->
metric
.
syntaxStart
,
pRequest
->
metric
.
ctgEnd
-
pRequest
->
metric
.
ctgStart
,
pRequest
->
metric
.
semanticEnd
-
pRequest
->
metric
.
ctgEnd
,
pRequest
->
metric
.
planEnd
-
pRequest
->
metric
.
semanticEnd
,
pRequest
->
metric
.
resultReady
-
pRequest
->
metric
.
planEnd
);
pRequest
->
metric
.
resultReady
-
pRequest
->
metric
.
planEnd
,
pRequest
->
requestId
);
atomic_add_fetch_64
((
int64_t
*
)
&
pActivity
->
queryElapsedTime
,
duration
);
}
...
...
source/client/src/clientImpl.c
浏览文件 @
027a0c11
...
...
@@ -870,8 +870,9 @@ int32_t handleQueryExecRsp(SRequestObj* pRequest) {
void
schedulerExecCb
(
SExecResult
*
pResult
,
void
*
param
,
int32_t
code
)
{
SRequestObj
*
pRequest
=
(
SRequestObj
*
)
param
;
pRequest
->
code
=
code
;
STscObj
*
pTscObj
=
pRequest
->
pTscObj
;
pRequest
->
code
=
code
;
pRequest
->
metric
.
resultReady
=
taosGetTimestampUs
();
if
(
pResult
)
{
...
...
@@ -879,31 +880,28 @@ void schedulerExecCb(SExecResult* pResult, void* param, int32_t code) {
memcpy
(
&
pRequest
->
body
.
resInfo
.
execRes
,
pResult
,
sizeof
(
*
pResult
));
}
i
f
(
TDMT_VND_SUBMIT
==
pRequest
->
type
||
TDMT_VND_DELETE
==
pRequest
->
type
||
TDMT_VND_CREATE_TABLE
==
pRequest
->
type
)
{
i
nt32_t
type
=
pRequest
->
type
;
if
(
TDMT_VND_SUBMIT
==
type
||
TDMT_VND_DELETE
==
type
||
TDMT_VND_CREATE_TABLE
==
type
)
{
if
(
pResult
)
{
pRequest
->
body
.
resInfo
.
numOfRows
=
pResult
->
numOfRows
;
if
(
TDMT_VND_SUBMIT
==
pRequest
->
type
)
{
STscObj
*
pTscObj
=
pRequest
->
pTscObj
;
// record the insert rows
if
(
TDMT_VND_SUBMIT
==
type
)
{
SAppClusterSummary
*
pActivity
=
&
pTscObj
->
pAppInfo
->
summary
;
atomic_add_fetch_64
((
int64_t
*
)
&
pActivity
->
numOfInsertRows
,
pResult
->
numOfRows
);
}
}
schedulerFreeJob
(
&
pRequest
->
body
.
queryJob
,
0
);
pRequest
->
metric
.
execEnd
=
taosGetTimestampUs
();
}
taosMemoryFree
(
pResult
);
tscDebug
(
"0x%"
PRIx64
" enter scheduler exec cb, code:%s, reqId:0x%"
PRIx64
,
pRequest
->
self
,
tstrerror
(
code
),
pRequest
->
requestId
);
tscDebug
(
"0x%"
PRIx64
" enter scheduler exec cb, code:%d - %s, reqId:0x%"
PRIx64
,
pRequest
->
self
,
code
,
tstrerror
(
code
),
pRequest
->
requestId
);
STscObj
*
pTscObj
=
pRequest
->
pTscObj
;
if
(
code
!=
TSDB_CODE_SUCCESS
&&
NEED_CLIENT_HANDLE_ERROR
(
code
)
&&
pRequest
->
sqlstr
!=
NULL
)
{
tscDebug
(
"0x%"
PRIx64
" client retry to handle the error, code:%
d - %
s, tryCount:%d, reqId:0x%"
PRIx64
,
pRequest
->
self
,
code
,
tstrerror
(
code
),
pRequest
->
retry
,
pRequest
->
requestId
);
tscDebug
(
"0x%"
PRIx64
" client retry to handle the error, code:%s, tryCount:%d, reqId:0x%"
PRIx64
,
pRequest
->
self
,
tstrerror
(
code
),
pRequest
->
retry
,
pRequest
->
requestId
);
pRequest
->
prevCode
=
code
;
schedulerFreeJob
(
&
pRequest
->
body
.
queryJob
,
0
);
doAsyncQuery
(
pRequest
,
true
);
...
...
@@ -915,7 +913,8 @@ void schedulerExecCb(SExecResult* pResult, void* param, int32_t code) {
removeMeta
(
pTscObj
,
pRequest
->
targetTableList
);
}
handleQueryExecRsp
(
pRequest
);
pRequest
->
metric
.
execEnd
=
taosGetTimestampUs
();
code
=
handleQueryExecRsp
(
pRequest
);
// return to client
pRequest
->
body
.
queryFp
(
pRequest
->
body
.
param
,
pRequest
,
code
);
...
...
source/client/src/clientMain.c
浏览文件 @
027a0c11
...
...
@@ -700,6 +700,7 @@ void retrieveMetaCallback(SMetaData *pResultMeta, void *param, int32_t code) {
SQuery
*
pQuery
=
pRequest
->
pQuery
;
pRequest
->
metric
.
ctgEnd
=
taosGetTimestampUs
();
qDebug
(
"0x%"
PRIx64
" start to semantic analysis, reqId:0x%"
PRIx64
,
pRequest
->
self
,
pRequest
->
requestId
);
if
(
code
==
TSDB_CODE_SUCCESS
)
{
code
=
qAnalyseSqlSemantic
(
pWrapper
->
pCtx
,
&
pWrapper
->
catalogReq
,
pResultMeta
,
pQuery
);
...
...
@@ -723,13 +724,16 @@ void retrieveMetaCallback(SMetaData *pResultMeta, void *param, int32_t code) {
destorySqlParseWrapper
(
pWrapper
);
tscDebug
(
"0x%"
PRIx64
" analysis semantics completed, start async query, reqId:0x%"
PRIx64
,
pRequest
->
self
,
pRequest
->
requestId
);
double
el
=
(
pRequest
->
metric
.
semanticEnd
-
pRequest
->
metric
.
ctgEnd
)
/
1000
.
0
;
tscDebug
(
"0x%"
PRIx64
" analysis semantics completed, start async query, elapsed time:%.2f ms, reqId:0x%"
PRIx64
,
pRequest
->
self
,
el
,
pRequest
->
requestId
);
launchAsyncQuery
(
pRequest
,
pQuery
,
pResultMeta
);
}
else
{
destorySqlParseWrapper
(
pWrapper
);
qDestroyQuery
(
pRequest
->
pQuery
);
pRequest
->
pQuery
=
NULL
;
if
(
NEED_CLIENT_HANDLE_ERROR
(
code
))
{
tscDebug
(
"0x%"
PRIx64
" client retry to handle the error, code:%d - %s, tryCount:%d, reqId:0x%"
PRIx64
,
pRequest
->
self
,
code
,
tstrerror
(
code
),
pRequest
->
retry
,
pRequest
->
requestId
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录