Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
慢慢CG
TDengine
提交
4c53af4f
T
TDengine
项目概览
慢慢CG
/
TDengine
与 Fork 源项目一致
Fork自
taosdata / TDengine
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
4c53af4f
编写于
8月 04, 2021
作者:
G
Ganlin Zhao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[TD-5729]<feature>: display subquery states and objIDs as one column sub_query_info
上级
771c2636
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
22 addition
and
41 deletion
+22
-41
src/client/src/tscProfile.c
src/client/src/tscProfile.c
+17
-4
src/inc/taosdef.h
src/inc/taosdef.h
+1
-1
src/inc/taosmsg.h
src/inc/taosmsg.h
+1
-2
src/mnode/src/mnodeProfile.c
src/mnode/src/mnodeProfile.c
+3
-34
未找到文件。
src/client/src/tscProfile.c
浏览文件 @
4c53af4f
...
...
@@ -256,11 +256,24 @@ int tscBuildQueryStreamDesc(void *pMsg, STscObj *pObj) {
pQdesc
->
sqlObjId
=
htobe64
(
pSql
->
self
);
pQdesc
->
pid
=
pHeartbeat
->
pid
;
pQdesc
->
stableQuery
=
pSql
->
cmd
.
pQueryInfo
->
stableQuery
;
pQdesc
->
numOfSub
=
(
pSql
->
subState
.
numOfSub
<=
TSDB_MAX_SUBQUERY_NUM
)
?
pSql
->
subState
.
numOfSub
:
TSDB_MAX_SUBQUERY_NUM
;
pQdesc
->
numOfSub
=
pSql
->
subState
.
numOfSub
;
for
(
int
i
=
0
;
i
<
pQdesc
->
numOfSub
;
++
i
)
{
pQdesc
->
subSqlStates
[
i
]
=
pSql
->
subState
.
states
[
i
];
pQdesc
->
subSqlObjIds
[
i
]
=
htobe64
(
pSql
->
pSubs
[
i
]
->
self
);
char
*
p
=
pQdesc
->
subSqlInfo
;
int32_t
remainLen
=
sizeof
(
pQdesc
->
subSqlInfo
);
if
(
pQdesc
->
numOfSub
==
0
)
{
snprintf
(
p
,
remainLen
,
"N/A"
);
}
else
{
int32_t
len
;
for
(
int32_t
i
=
0
;
i
<
pQdesc
->
numOfSub
;
++
i
)
{
len
=
snprintf
(
p
,
remainLen
,
"[%d]0x%"
PRIx64
"(%c) "
,
i
,
pSql
->
pSubs
[
i
]
->
self
,
pSql
->
subState
.
states
[
i
]
?
'C'
:
'I'
);
if
(
len
>
remainLen
)
{
break
;
}
remainLen
-=
len
;
p
+=
len
;
}
}
pQdesc
->
numOfSub
=
htonl
(
pQdesc
->
numOfSub
);
...
...
src/inc/taosdef.h
浏览文件 @
4c53af4f
...
...
@@ -223,6 +223,7 @@ do { \
#define TSDB_IPv4ADDR_LEN 16
#define TSDB_FILENAME_LEN 128
#define TSDB_SHOW_SQL_LEN 512
#define TSDB_SHOW_SUBQUERY_LEN 1000
#define TSDB_SLOW_QUERY_SQL_LEN 512
#define TSDB_STEP_NAME_LEN 32
...
...
@@ -339,7 +340,6 @@ do { \
#define PRIMARYKEY_TIMESTAMP_COL_INDEX 0
#define TSDB_MAX_RPC_THREADS 5
#define TSDB_MAX_SUBQUERY_NUM 10
#define TSDB_QUERY_TYPE_NON_TYPE 0x00u // none type
#define TSDB_QUERY_TYPE_FREE_RESOURCE 0x01u // free qhandle at vnode
...
...
src/inc/taosmsg.h
浏览文件 @
4c53af4f
...
...
@@ -879,8 +879,7 @@ typedef struct {
char
fqdn
[
TSDB_FQDN_LEN
];
bool
stableQuery
;
int32_t
numOfSub
;
int8_t
subSqlStates
[
TSDB_MAX_SUBQUERY_NUM
];
int64_t
subSqlObjIds
[
TSDB_MAX_SUBQUERY_NUM
];
char
subSqlInfo
[
TSDB_SHOW_SUBQUERY_LEN
];
//include subqueries' index, Obj IDs and states(C-complete/I-imcomplete)
}
SQueryDesc
;
typedef
struct
{
...
...
src/mnode/src/mnodeProfile.c
浏览文件 @
4c53af4f
...
...
@@ -393,15 +393,9 @@ static int32_t mnodeGetQueryMeta(STableMetaMsg *pMeta, SShowObj *pShow, void *pC
pSchema
[
cols
].
bytes
=
htons
(
pShow
->
bytes
[
cols
]);
cols
++
;
pShow
->
bytes
[
cols
]
=
SUBQUERY_INFO_SIZE
*
TSDB_MAX_SUBQUERY_NUM
+
VARSTR_HEADER_SIZE
;
pShow
->
bytes
[
cols
]
=
TSDB_SHOW_SUBQUERY_LEN
+
VARSTR_HEADER_SIZE
;
pSchema
[
cols
].
type
=
TSDB_DATA_TYPE_BINARY
;
strcpy
(
pSchema
[
cols
].
name
,
"sub_query_states"
);
pSchema
[
cols
].
bytes
=
htons
(
pShow
->
bytes
[
cols
]);
cols
++
;
pShow
->
bytes
[
cols
]
=
(
SUBQUERY_INFO_SIZE
+
QUERY_OBJ_ID_SIZE
)
*
TSDB_MAX_SUBQUERY_NUM
+
VARSTR_HEADER_SIZE
;
pSchema
[
cols
].
type
=
TSDB_DATA_TYPE_BINARY
;
strcpy
(
pSchema
[
cols
].
name
,
"sub_query_obj_ids "
);
strcpy
(
pSchema
[
cols
].
name
,
"sub_query_info"
);
pSchema
[
cols
].
bytes
=
htons
(
pShow
->
bytes
[
cols
]);
cols
++
;
...
...
@@ -502,33 +496,8 @@ static int32_t mnodeRetrieveQueries(SShowObj *pShow, char *data, int32_t rows, v
*
(
int32_t
*
)
pWrite
=
htonl
(
pDesc
->
numOfSub
);
cols
++
;
char
subQInfo
[(
SUBQUERY_INFO_SIZE
+
QUERY_OBJ_ID_SIZE
)
*
TSDB_MAX_SUBQUERY_NUM
]
=
{
0
};
char
*
p
;
int32_t
idx
,
len
;
p
=
subQInfo
;
for
(
idx
=
0
;
idx
<
htonl
(
pDesc
->
numOfSub
);
++
idx
)
{
len
=
snprintf
(
p
,
SUBQUERY_INFO_SIZE
,
"[%d]%d "
,
idx
,
pDesc
->
subSqlStates
[
idx
]);
p
+=
MIN
(
len
,
SUBQUERY_INFO_SIZE
);
}
if
(
idx
==
0
)
{
snprintf
(
p
,
sizeof
(
subQInfo
),
"N/A"
);
}
pWrite
=
data
+
pShow
->
offset
[
cols
]
*
rows
+
pShow
->
bytes
[
cols
]
*
numOfRows
;
STR_WITH_MAXSIZE_TO_VARSTR
(
pWrite
,
subQInfo
,
pShow
->
bytes
[
cols
]);
cols
++
;
p
=
subQInfo
;
for
(
idx
=
0
;
idx
<
htonl
(
pDesc
->
numOfSub
);
++
idx
)
{
len
=
snprintf
(
p
,
SUBQUERY_INFO_SIZE
+
QUERY_OBJ_ID_SIZE
,
"[%d]0x%"
PRIx64
" "
,
idx
,
htobe64
(
pDesc
->
subSqlObjIds
[
idx
]));
p
+=
MIN
(
len
,
SUBQUERY_INFO_SIZE
+
QUERY_OBJ_ID_SIZE
);
}
if
(
idx
==
0
)
{
snprintf
(
p
,
sizeof
(
subQInfo
),
"N/A"
);
}
pWrite
=
data
+
pShow
->
offset
[
cols
]
*
rows
+
pShow
->
bytes
[
cols
]
*
numOfRows
;
STR_WITH_MAXSIZE_TO_VARSTR
(
pWrite
,
subQ
Info
,
pShow
->
bytes
[
cols
]);
STR_WITH_MAXSIZE_TO_VARSTR
(
pWrite
,
pDesc
->
subSql
Info
,
pShow
->
bytes
[
cols
]);
cols
++
;
pWrite
=
data
+
pShow
->
offset
[
cols
]
*
rows
+
pShow
->
bytes
[
cols
]
*
numOfRows
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录