Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
a52c0cb5
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看板
提交
a52c0cb5
编写于
9月 19, 2022
作者:
S
slzhou
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix: improve group by performance by skip sort when group by
上级
29ca49bb
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
30 addition
and
3 deletion
+30
-3
src/common/inc/tglobal.h
src/common/inc/tglobal.h
+2
-0
src/common/src/tglobal.c
src/common/src/tglobal.c
+25
-0
src/query/src/qExecutor.c
src/query/src/qExecutor.c
+2
-2
src/util/inc/tconfig.h
src/util/inc/tconfig.h
+1
-1
未找到文件。
src/common/inc/tglobal.h
浏览文件 @
a52c0cb5
...
@@ -67,6 +67,8 @@ extern int32_t tsCompressColData;
...
@@ -67,6 +67,8 @@ extern int32_t tsCompressColData;
extern
int32_t
tsMaxNumOfDistinctResults
;
extern
int32_t
tsMaxNumOfDistinctResults
;
extern
char
tsTempDir
[];
extern
char
tsTempDir
[];
extern
int32_t
tsShortcutFlag
;
extern
int32_t
tsShortcutFlag
;
extern
int32_t
tsMaxSqlGroups
;
extern
int8_t
tsSortWhenGroupBy
;
// query buffer management
// query buffer management
extern
int32_t
tsQueryBufferSize
;
// maximum allowed usage buffer size in MB for each data node during query processing
extern
int32_t
tsQueryBufferSize
;
// maximum allowed usage buffer size in MB for each data node during query processing
...
...
src/common/src/tglobal.c
浏览文件 @
a52c0cb5
...
@@ -118,6 +118,12 @@ int32_t tsRetryStreamCompDelay = 30 * 60 * 1000;
...
@@ -118,6 +118,12 @@ int32_t tsRetryStreamCompDelay = 30 * 60 * 1000;
// The delayed computing ration. 10% of the whole computing time window by default.
// The delayed computing ration. 10% of the whole computing time window by default.
float
tsStreamComputDelayRatio
=
0
.
1
f
;
float
tsStreamComputDelayRatio
=
0
.
1
f
;
// max supported groups for group by clause / interval clause
int32_t
tsMaxSqlGroups
=
1000000
;
// order by first group by column when group by
int8_t
tsSortWhenGroupBy
=
1
;
int32_t
tsProjectExecInterval
=
10000
;
// every 10sec, the projection will be executed once
int32_t
tsProjectExecInterval
=
10000
;
// every 10sec, the projection will be executed once
int64_t
tsMaxRetentWindow
=
24
*
3600L
;
// maximum time window tolerance
int64_t
tsMaxRetentWindow
=
24
*
3600L
;
// maximum time window tolerance
...
@@ -1772,6 +1778,25 @@ static void doInitGlobalConfig(void) {
...
@@ -1772,6 +1778,25 @@ static void doInitGlobalConfig(void) {
cfg
.
unitType
=
TAOS_CFG_UTYPE_NONE
;
cfg
.
unitType
=
TAOS_CFG_UTYPE_NONE
;
taosInitConfigOption
(
cfg
);
taosInitConfigOption
(
cfg
);
cfg
.
option
=
"maxSqlGroups"
;
cfg
.
ptr
=
&
tsMaxSqlGroups
;
cfg
.
valType
=
TAOS_CFG_VTYPE_INT32
;
cfg
.
cfgType
=
TSDB_CFG_CTYPE_B_CONFIG
;
cfg
.
minValue
=
500000
;
cfg
.
maxValue
=
10000000
;
cfg
.
ptrLength
=
0
;
cfg
.
unitType
=
TAOS_CFG_UTYPE_NONE
;
cfg
.
option
=
"sortWhenGroupBy"
;
cfg
.
ptr
=
&
tsSortWhenGroupBy
;
cfg
.
valType
=
TAOS_CFG_VTYPE_INT8
;
cfg
.
cfgType
=
TSDB_CFG_CTYPE_B_CONFIG
;
cfg
.
minValue
=
0
;
cfg
.
maxValue
=
1
;
cfg
.
ptrLength
=
0
;
cfg
.
unitType
=
TAOS_CFG_UTYPE_NONE
;
taosInitConfigOption
(
cfg
);
#ifdef TD_TSZ
#ifdef TD_TSZ
// lossy compress
// lossy compress
cfg
.
option
=
"lossyColumns"
;
cfg
.
option
=
"lossyColumns"
;
...
...
src/query/src/qExecutor.c
浏览文件 @
a52c0cb5
...
@@ -621,7 +621,7 @@ static SResultRow* doSetResultOutBufByKey(SQueryRuntimeEnv* pRuntimeEnv, SResult
...
@@ -621,7 +621,7 @@ static SResultRow* doSetResultOutBufByKey(SQueryRuntimeEnv* pRuntimeEnv, SResult
}
}
// too many time window in query
// too many time window in query
if
(
pResultRowInfo
->
size
>
MAX_INTERVAL_TIME_WINDOW
)
{
if
(
pResultRowInfo
->
size
>
tsMaxSqlGroups
)
{
longjmp
(
pRuntimeEnv
->
env
,
TSDB_CODE_QRY_TOO_MANY_TIMEWINDOW
);
longjmp
(
pRuntimeEnv
->
env
,
TSDB_CODE_QRY_TOO_MANY_TIMEWINDOW
);
}
}
...
@@ -7607,7 +7607,7 @@ static SSDataBlock* hashGroupbyAggregate(void* param, bool* newgroup) {
...
@@ -7607,7 +7607,7 @@ static SSDataBlock* hashGroupbyAggregate(void* param, bool* newgroup) {
}
}
initGroupResInfo
(
&
pRuntimeEnv
->
groupResInfo
,
&
pInfo
->
binfo
.
resultRowInfo
);
initGroupResInfo
(
&
pRuntimeEnv
->
groupResInfo
,
&
pInfo
->
binfo
.
resultRowInfo
);
if
(
!
pRuntimeEnv
->
pQueryAttr
->
stableQuery
)
{
if
(
!
pRuntimeEnv
->
pQueryAttr
->
stableQuery
&&
tsSortWhenGroupBy
)
{
sortGroupResByOrderList
(
&
pRuntimeEnv
->
groupResInfo
,
pRuntimeEnv
,
pInfo
->
binfo
.
pRes
,
pInfo
->
binfo
.
pCtx
);
sortGroupResByOrderList
(
&
pRuntimeEnv
->
groupResInfo
,
pRuntimeEnv
,
pInfo
->
binfo
.
pRes
,
pInfo
->
binfo
.
pCtx
);
}
}
...
...
src/util/inc/tconfig.h
浏览文件 @
a52c0cb5
...
@@ -20,7 +20,7 @@
...
@@ -20,7 +20,7 @@
extern
"C"
{
extern
"C"
{
#endif
#endif
#define TSDB_CFG_MAX_NUM 13
4
#define TSDB_CFG_MAX_NUM 13
6
#define TSDB_CFG_PRINT_LEN 23
#define TSDB_CFG_PRINT_LEN 23
#define TSDB_CFG_OPTION_LEN 24
#define TSDB_CFG_OPTION_LEN 24
#define TSDB_CFG_VALUE_LEN 41
#define TSDB_CFG_VALUE_LEN 41
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录