Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
faa73182
T
TDengine
项目概览
taosdata
/
TDengine
大约 1 年 前同步成功
通知
1184
Star
22015
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
faa73182
编写于
9月 01, 2022
作者:
X
Xiaoyu Wang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
enh: add the queryPlannerTrace parameter to control the debug output of the planner
上级
a91a82ee
变更
5
显示空白变更内容
内联
并排
Showing
5 changed file
with
22 addition
and
17 deletion
+22
-17
include/common/tglobal.h
include/common/tglobal.h
+3
-2
source/common/src/tglobal.c
source/common/src/tglobal.c
+14
-12
source/libs/planner/src/planOptimizer.c
source/libs/planner/src/planOptimizer.c
+2
-1
source/libs/planner/src/planSpliter.c
source/libs/planner/src/planSpliter.c
+1
-1
source/libs/planner/src/planner.c
source/libs/planner/src/planner.c
+2
-1
未找到文件。
include/common/tglobal.h
浏览文件 @
faa73182
...
@@ -94,6 +94,7 @@ extern int64_t tsQueryBufferSizeBytes; // maximum allowed usage buffer size in
...
@@ -94,6 +94,7 @@ extern int64_t tsQueryBufferSizeBytes; // maximum allowed usage buffer size in
// query client
// query client
extern
int32_t
tsQueryPolicy
;
extern
int32_t
tsQueryPolicy
;
extern
int32_t
tsQuerySmaOptimize
;
extern
int32_t
tsQuerySmaOptimize
;
extern
bool
tsQueryPlannerTrace
;
// client
// client
extern
int32_t
tsMinSlidingTime
;
extern
int32_t
tsMinSlidingTime
;
...
@@ -147,7 +148,7 @@ struct SConfig *taosGetCfg();
...
@@ -147,7 +148,7 @@ struct SConfig *taosGetCfg();
void
taosSetAllDebugFlag
(
int32_t
flag
,
bool
rewrite
);
void
taosSetAllDebugFlag
(
int32_t
flag
,
bool
rewrite
);
void
taosSetDebugFlag
(
int32_t
*
pFlagPtr
,
const
char
*
flagName
,
int32_t
flagVal
,
bool
rewrite
);
void
taosSetDebugFlag
(
int32_t
*
pFlagPtr
,
const
char
*
flagName
,
int32_t
flagVal
,
bool
rewrite
);
int32_t
taosSetCfg
(
SConfig
*
pCfg
,
char
*
name
);
int32_t
taosSetCfg
(
SConfig
*
pCfg
,
char
*
name
);
void
taosLocalCfgForbiddenToChange
(
char
*
name
,
bool
*
forbidden
);
void
taosLocalCfgForbiddenToChange
(
char
*
name
,
bool
*
forbidden
);
#ifdef __cplusplus
#ifdef __cplusplus
}
}
...
...
source/common/src/tglobal.c
浏览文件 @
faa73182
...
@@ -91,6 +91,7 @@ bool tsSmlDataFormat =
...
@@ -91,6 +91,7 @@ bool tsSmlDataFormat =
// query
// query
int32_t
tsQueryPolicy
=
1
;
int32_t
tsQueryPolicy
=
1
;
int32_t
tsQuerySmaOptimize
=
0
;
int32_t
tsQuerySmaOptimize
=
0
;
bool
tsQueryPlannerTrace
=
false
;
/*
/*
* denote if the server needs to compress response message at the application layer to client, including query rsp,
* denote if the server needs to compress response message at the application layer to client, including query rsp,
...
@@ -286,6 +287,7 @@ static int32_t taosAddClientCfg(SConfig *pCfg) {
...
@@ -286,6 +287,7 @@ static int32_t taosAddClientCfg(SConfig *pCfg) {
if
(
cfgAddInt32
(
pCfg
,
"compressColData"
,
tsCompressColData
,
-
1
,
100000000
,
1
)
!=
0
)
return
-
1
;
if
(
cfgAddInt32
(
pCfg
,
"compressColData"
,
tsCompressColData
,
-
1
,
100000000
,
1
)
!=
0
)
return
-
1
;
if
(
cfgAddInt32
(
pCfg
,
"queryPolicy"
,
tsQueryPolicy
,
1
,
3
,
1
)
!=
0
)
return
-
1
;
if
(
cfgAddInt32
(
pCfg
,
"queryPolicy"
,
tsQueryPolicy
,
1
,
3
,
1
)
!=
0
)
return
-
1
;
if
(
cfgAddInt32
(
pCfg
,
"querySmaOptimize"
,
tsQuerySmaOptimize
,
0
,
1
,
1
)
!=
0
)
return
-
1
;
if
(
cfgAddInt32
(
pCfg
,
"querySmaOptimize"
,
tsQuerySmaOptimize
,
0
,
1
,
1
)
!=
0
)
return
-
1
;
if
(
cfgAddBool
(
pCfg
,
"queryPlannerTrace"
,
tsQueryPlannerTrace
,
true
)
!=
0
)
return
-
1
;
if
(
cfgAddString
(
pCfg
,
"smlChildTableName"
,
""
,
1
)
!=
0
)
return
-
1
;
if
(
cfgAddString
(
pCfg
,
"smlChildTableName"
,
""
,
1
)
!=
0
)
return
-
1
;
if
(
cfgAddString
(
pCfg
,
"smlTagName"
,
tsSmlTagName
,
1
)
!=
0
)
return
-
1
;
if
(
cfgAddString
(
pCfg
,
"smlTagName"
,
tsSmlTagName
,
1
)
!=
0
)
return
-
1
;
if
(
cfgAddBool
(
pCfg
,
"smlDataFormat"
,
tsSmlDataFormat
,
1
)
!=
0
)
return
-
1
;
if
(
cfgAddBool
(
pCfg
,
"smlDataFormat"
,
tsSmlDataFormat
,
1
)
!=
0
)
return
-
1
;
...
@@ -572,7 +574,6 @@ static int32_t taosUpdateServerCfg(SConfig *pCfg) {
...
@@ -572,7 +574,6 @@ static int32_t taosUpdateServerCfg(SConfig *pCfg) {
return
0
;
return
0
;
}
}
static
void
taosSetClientLogCfg
(
SConfig
*
pCfg
)
{
static
void
taosSetClientLogCfg
(
SConfig
*
pCfg
)
{
SConfigItem
*
pItem
=
cfgGetItem
(
pCfg
,
"logDir"
);
SConfigItem
*
pItem
=
cfgGetItem
(
pCfg
,
"logDir"
);
tstrncpy
(
tsLogDir
,
cfgGetItem
(
pCfg
,
"logDir"
)
->
str
,
PATH_MAX
);
tstrncpy
(
tsLogDir
,
cfgGetItem
(
pCfg
,
"logDir"
)
->
str
,
PATH_MAX
);
...
@@ -643,6 +644,7 @@ static int32_t taosSetClientCfg(SConfig *pCfg) {
...
@@ -643,6 +644,7 @@ static int32_t taosSetClientCfg(SConfig *pCfg) {
tsNumOfTaskQueueThreads
=
cfgGetItem
(
pCfg
,
"numOfTaskQueueThreads"
)
->
i32
;
tsNumOfTaskQueueThreads
=
cfgGetItem
(
pCfg
,
"numOfTaskQueueThreads"
)
->
i32
;
tsQueryPolicy
=
cfgGetItem
(
pCfg
,
"queryPolicy"
)
->
i32
;
tsQueryPolicy
=
cfgGetItem
(
pCfg
,
"queryPolicy"
)
->
i32
;
tsQuerySmaOptimize
=
cfgGetItem
(
pCfg
,
"querySmaOptimize"
)
->
i32
;
tsQuerySmaOptimize
=
cfgGetItem
(
pCfg
,
"querySmaOptimize"
)
->
i32
;
tsQueryPlannerTrace
=
cfgGetItem
(
pCfg
,
"queryPlannerTrace"
)
->
bval
;
return
0
;
return
0
;
}
}
...
@@ -972,6 +974,8 @@ int32_t taosSetCfg(SConfig *pCfg, char *name) {
...
@@ -972,6 +974,8 @@ int32_t taosSetCfg(SConfig *pCfg, char *name) {
tsQnodeShmSize
=
cfgGetItem
(
pCfg
,
"qnodeShmSize"
)
->
i32
;
tsQnodeShmSize
=
cfgGetItem
(
pCfg
,
"qnodeShmSize"
)
->
i32
;
}
else
if
(
strcasecmp
(
"qDebugFlag"
,
name
)
==
0
)
{
}
else
if
(
strcasecmp
(
"qDebugFlag"
,
name
)
==
0
)
{
qDebugFlag
=
cfgGetItem
(
pCfg
,
"qDebugFlag"
)
->
i32
;
qDebugFlag
=
cfgGetItem
(
pCfg
,
"qDebugFlag"
)
->
i32
;
}
else
if
(
strcasecmp
(
"queryPlannerTrace"
,
name
)
==
0
)
{
tsQueryPlannerTrace
=
cfgGetItem
(
pCfg
,
"queryPlannerTrace"
)
->
bval
;
}
}
break
;
break
;
}
}
...
@@ -1241,16 +1245,14 @@ void taosCfgDynamicOptions(const char *option, const char *value) {
...
@@ -1241,16 +1245,14 @@ void taosCfgDynamicOptions(const char *option, const char *value) {
}
}
const
char
*
options
[]
=
{
const
char
*
options
[]
=
{
"dDebugFlag"
,
"vDebugFlag"
,
"mDebugFlag"
,
"wDebugFlag"
,
"sDebugFlag"
,
"tsdbDebugFlag"
,
"dDebugFlag"
,
"vDebugFlag"
,
"mDebugFlag"
,
"wDebugFlag"
,
"sDebugFlag"
,
"tsdbDebugFlag"
,
"tqDebugFlag"
,
"tqDebugFlag"
,
"fsDebugFlag"
,
"udfDebugFlag"
,
"smaDebugFlag"
,
"idxDebugFlag"
,
"tdbDebugFlag"
,
"fsDebugFlag"
,
"udfDebugFlag"
,
"smaDebugFlag"
,
"idxDebugFlag"
,
"tdbDebugFlag"
,
"tmrDebugFlag"
,
"uDebugFlag"
,
"tmrDebugFlag"
,
"uDebugFlag"
,
"smaDebugFlag"
,
"rpcDebugFlag"
,
"qDebugFlag"
,
"metaDebugFlag"
,
"smaDebugFlag"
,
"rpcDebugFlag"
,
"qDebugFlag"
,
"metaDebugFlag"
,
"jniDebugFlag"
,
"jniDebugFlag"
,
};
};
int32_t
*
optionVars
[]
=
{
int32_t
*
optionVars
[]
=
{
&
dDebugFlag
,
&
vDebugFlag
,
&
mDebugFlag
,
&
wDebugFlag
,
&
sDebugFlag
,
&
tsdbDebugFlag
,
&
dDebugFlag
,
&
vDebugFlag
,
&
mDebugFlag
,
&
wDebugFlag
,
&
sDebugFlag
,
&
tsdbDebugFlag
,
&
tqDebugFlag
,
&
tqDebugFlag
,
&
fsDebugFlag
,
&
udfDebugFlag
,
&
smaDebugFlag
,
&
idxDebugFlag
,
&
tdbDebugFlag
,
&
fsDebugFlag
,
&
udfDebugFlag
,
&
smaDebugFlag
,
&
idxDebugFlag
,
&
tdbDebugFlag
,
&
tmrDebugFlag
,
&
uDebugFlag
,
&
tmrDebugFlag
,
&
uDebugFlag
,
&
smaDebugFlag
,
&
rpcDebugFlag
,
&
qDebugFlag
,
&
metaDebugFlag
,
&
smaDebugFlag
,
&
rpcDebugFlag
,
&
qDebugFlag
,
&
metaDebugFlag
,
&
jniDebugFlag
,
&
jniDebugFlag
,
};
};
int32_t
optionSize
=
tListLen
(
options
);
int32_t
optionSize
=
tListLen
(
options
);
...
...
source/libs/planner/src/planOptimizer.c
浏览文件 @
faa73182
...
@@ -16,6 +16,7 @@
...
@@ -16,6 +16,7 @@
#include "filter.h"
#include "filter.h"
#include "functionMgt.h"
#include "functionMgt.h"
#include "planInt.h"
#include "planInt.h"
#include "tglobal.h"
#include "ttime.h"
#include "ttime.h"
#define OPTIMIZE_FLAG_MASK(n) (1 << n)
#define OPTIMIZE_FLAG_MASK(n) (1 << n)
...
@@ -2410,7 +2411,7 @@ static const SOptimizeRule optimizeRuleSet[] = {
...
@@ -2410,7 +2411,7 @@ static const SOptimizeRule optimizeRuleSet[] = {
static
const
int32_t
optimizeRuleNum
=
(
sizeof
(
optimizeRuleSet
)
/
sizeof
(
SOptimizeRule
));
static
const
int32_t
optimizeRuleNum
=
(
sizeof
(
optimizeRuleSet
)
/
sizeof
(
SOptimizeRule
));
static
void
dumpLogicSubplan
(
const
char
*
pRuleName
,
SLogicSubplan
*
pSubplan
)
{
static
void
dumpLogicSubplan
(
const
char
*
pRuleName
,
SLogicSubplan
*
pSubplan
)
{
if
(
0
==
(
qDebugFlag
&
DEBUG_DEBUG
)
)
{
if
(
!
tsQueryPlannerTrace
)
{
return
;
return
;
}
}
char
*
pStr
=
NULL
;
char
*
pStr
=
NULL
;
...
...
source/libs/planner/src/planSpliter.c
浏览文件 @
faa73182
...
@@ -1427,7 +1427,7 @@ static const SSplitRule splitRuleSet[] = {
...
@@ -1427,7 +1427,7 @@ static const SSplitRule splitRuleSet[] = {
static
const
int32_t
splitRuleNum
=
(
sizeof
(
splitRuleSet
)
/
sizeof
(
SSplitRule
));
static
const
int32_t
splitRuleNum
=
(
sizeof
(
splitRuleSet
)
/
sizeof
(
SSplitRule
));
static
void
dumpLogicSubplan
(
const
char
*
pRuleName
,
SLogicSubplan
*
pSubplan
)
{
static
void
dumpLogicSubplan
(
const
char
*
pRuleName
,
SLogicSubplan
*
pSubplan
)
{
if
(
0
==
(
qDebugFlag
&
DEBUG_DEBUG
)
)
{
if
(
!
tsQueryPlannerTrace
)
{
return
;
return
;
}
}
char
*
pStr
=
NULL
;
char
*
pStr
=
NULL
;
...
...
source/libs/planner/src/planner.c
浏览文件 @
faa73182
...
@@ -17,9 +17,10 @@
...
@@ -17,9 +17,10 @@
#include "planInt.h"
#include "planInt.h"
#include "scalar.h"
#include "scalar.h"
#include "tglobal.h"
static
void
dumpQueryPlan
(
SQueryPlan
*
pPlan
)
{
static
void
dumpQueryPlan
(
SQueryPlan
*
pPlan
)
{
if
(
0
==
(
qDebugFlag
&
DEBUG_DEBUG
)
)
{
if
(
!
tsQueryPlannerTrace
)
{
return
;
return
;
}
}
char
*
pStr
=
NULL
;
char
*
pStr
=
NULL
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录