Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
冷面1992
TDengine
提交
a9ba061c
TDengine
项目概览
冷面1992
/
TDengine
与 Fork 源项目一致
Fork自
taosdata / TDengine
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
a9ba061c
编写于
8月 19, 2021
作者:
H
Haojun Liao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[td-6216] Send the client query requests in parallel.
上级
c1f224ec
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
51 addition
and
7 deletion
+51
-7
src/client/src/tscSubquery.c
src/client/src/tscSubquery.c
+47
-7
src/query/src/qExecutor.c
src/query/src/qExecutor.c
+4
-0
未找到文件。
src/client/src/tscSubquery.c
浏览文件 @
a9ba061c
...
...
@@ -2433,6 +2433,26 @@ int32_t tscHandleFirstRoundStableQuery(SSqlObj *pSql) {
return
terrno
;
}
typedef
struct
SPair
{
int32_t
first
;
int32_t
second
;
}
SPair
;
static
void
doSendQueryReqs
(
SSchedMsg
*
pSchedMsg
)
{
SSqlObj
*
pSql
=
pSchedMsg
->
ahandle
;
SPair
*
p
=
pSchedMsg
->
msg
;
for
(
int32_t
i
=
p
->
first
;
i
<
p
->
second
;
++
i
)
{
SSqlObj
*
pSub
=
pSql
->
pSubs
[
i
];
SRetrieveSupport
*
pSupport
=
pSub
->
param
;
tscDebug
(
"0x%"
PRIx64
" sub:0x%"
PRIx64
" launch subquery, orderOfSub:%d."
,
pSql
->
self
,
pSub
->
self
,
pSupport
->
subqueryIndex
);
tscBuildAndSendRequest
(
pSub
,
NULL
);
}
tfree
(
p
);
}
int32_t
tscHandleMasterSTableQuery
(
SSqlObj
*
pSql
)
{
SSqlRes
*
pRes
=
&
pSql
->
res
;
SSqlCmd
*
pCmd
=
&
pSql
->
cmd
;
...
...
@@ -2555,13 +2575,33 @@ int32_t tscHandleMasterSTableQuery(SSqlObj *pSql) {
doCleanupSubqueries
(
pSql
,
i
);
return
pRes
->
code
;
}
for
(
int32_t
j
=
0
;
j
<
pState
->
numOfSub
;
++
j
)
{
SSqlObj
*
pSub
=
pSql
->
pSubs
[
j
];
SRetrieveSupport
*
pSupport
=
pSub
->
param
;
tscDebug
(
"0x%"
PRIx64
" sub:0x%"
PRIx64
" launch subquery, orderOfSub:%d."
,
pSql
->
self
,
pSub
->
self
,
pSupport
->
subqueryIndex
);
tscBuildAndSendRequest
(
pSub
,
NULL
);
// concurrently sent the query requests.
const
int32_t
MAX_REQUEST_PER_TASK
=
8
;
int32_t
numOfTasks
=
(
pState
->
numOfSub
+
MAX_REQUEST_PER_TASK
-
1
)
/
MAX_REQUEST_PER_TASK
;
assert
(
numOfTasks
>=
1
);
int32_t
num
=
(
pState
->
numOfSub
/
numOfTasks
)
+
1
;
tscDebug
(
"0x%"
PRIx64
" query will be sent by %d threads"
,
pSql
->
self
,
numOfTasks
);
for
(
int32_t
j
=
0
;
j
<
numOfTasks
;
++
j
)
{
SSchedMsg
schedMsg
=
{
0
};
schedMsg
.
fp
=
doSendQueryReqs
;
schedMsg
.
ahandle
=
(
void
*
)
pSql
;
schedMsg
.
thandle
=
NULL
;
SPair
*
p
=
calloc
(
1
,
sizeof
(
SPair
));
p
->
first
=
j
*
num
;
if
(
j
==
numOfTasks
-
1
)
{
p
->
second
=
pState
->
numOfSub
;
}
else
{
p
->
second
=
(
j
+
1
)
*
num
;
}
schedMsg
.
msg
=
p
;
taosScheduleTask
(
tscQhandle
,
&
schedMsg
);
}
return
TSDB_CODE_SUCCESS
;
...
...
src/query/src/qExecutor.c
浏览文件 @
a9ba061c
...
...
@@ -7079,6 +7079,10 @@ static SSDataBlock* doTagScan(void* param, bool* newgroup) {
qDebug
(
"QInfo:0x%"
PRIx64
" create tag values results completed, rows:%d"
,
GET_QID
(
pRuntimeEnv
),
count
);
}
if
(
pOperator
->
status
==
OP_EXEC_DONE
)
{
setQueryStatus
(
pOperator
->
pRuntimeEnv
,
QUERY_COMPLETED
);
}
pRes
->
info
.
rows
=
count
;
return
(
pRes
->
info
.
rows
==
0
)
?
NULL
:
pInfo
->
pRes
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录