Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
8a140660
T
TDengine
项目概览
taosdata
/
TDengine
接近 2 年 前同步成功
通知
1191
Star
22018
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看板
提交
8a140660
编写于
8月 12, 2021
作者:
G
Ganlin Zhao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[TD-5623]<feature>: changed compression threshhold check, if column size
exceeds certain amount will compress the whole block.
上级
65fefbd1
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
26 addition
and
5 deletion
+26
-5
src/query/inc/qExecutor.h
src/query/inc/qExecutor.h
+2
-1
src/query/src/qExecutor.c
src/query/src/qExecutor.c
+23
-3
src/query/src/queryMain.c
src/query/src/queryMain.c
+1
-1
未找到文件。
src/query/inc/qExecutor.h
浏览文件 @
8a140660
...
...
@@ -43,7 +43,7 @@ typedef int32_t (*__block_search_fn_t)(char* data, int32_t num, int64_t key, int
#define GET_NUM_OF_RESULTS(_r) (((_r)->outputBuf) == NULL? 0:((_r)->outputBuf)->info.rows)
#define QUERY_COMP_THRESHOLD
60
#define QUERY_COMP_THRESHOLD
16
#define NEEDTO_COMPRESS_QUERY(size) ((size) > QUERY_COMP_THRESHOLD ? 1 : 0)
enum
{
...
...
@@ -642,6 +642,7 @@ int32_t buildArithmeticExprFromMsg(SExprInfo *pArithExprInfo, void *pQueryMsg);
bool
isQueryKilled
(
SQInfo
*
pQInfo
);
int32_t
checkForQueryBuf
(
size_t
numOfTables
);
bool
checkNeedToCompressQueryCol
(
SQInfo
*
pQInfo
);
bool
doBuildResCheck
(
SQInfo
*
pQInfo
);
void
setQueryStatus
(
SQueryRuntimeEnv
*
pRuntimeEnv
,
int8_t
status
);
...
...
src/query/src/qExecutor.c
浏览文件 @
8a140660
...
...
@@ -4194,9 +4194,9 @@ static void updateNumOfRowsInResultRows(SQueryRuntimeEnv* pRuntimeEnv, SQLFuncti
}
static
int32_t
compressQueryColData
(
SColumnInfoData
*
pColRes
,
int32_t
numOfRows
,
char
*
data
,
int8_t
compressed
)
{
int32_t
col
Len
=
pColRes
->
info
.
bytes
*
numOfRows
;
return
(
*
(
tDataTypes
[
pColRes
->
info
.
type
].
compFunc
))(
pColRes
->
pData
,
col
Len
,
numOfRows
,
data
,
col
Len
+
COMP_OVERFLOW_BYTES
,
compressed
,
NULL
,
0
);
int32_t
col
Size
=
pColRes
->
info
.
bytes
*
numOfRows
;
return
(
*
(
tDataTypes
[
pColRes
->
info
.
type
].
compFunc
))(
pColRes
->
pData
,
col
Size
,
numOfRows
,
data
,
col
Size
+
COMP_OVERFLOW_BYTES
,
compressed
,
NULL
,
0
);
}
static
void
doCopyQueryResultToMsg
(
SQInfo
*
pQInfo
,
int32_t
numOfRows
,
char
*
data
,
int8_t
compressed
,
int32_t
*
compLen
)
{
...
...
@@ -8858,6 +8858,26 @@ int32_t checkForQueryBuf(size_t numOfTables) {
return
TSDB_CODE_QRY_NOT_ENOUGH_BUFFER
;
}
bool
checkNeedToCompressQueryCol
(
SQInfo
*
pQInfo
)
{
SQueryRuntimeEnv
*
pRuntimeEnv
=
&
pQInfo
->
runtimeEnv
;
SQueryAttr
*
pQueryAttr
=
pRuntimeEnv
->
pQueryAttr
;
SSDataBlock
*
pRes
=
pRuntimeEnv
->
outputBuf
;
int32_t
numOfRows
=
pQueryAttr
->
pExpr2
?
GET_NUM_OF_RESULTS
(
pRuntimeEnv
)
:
pRes
->
info
.
rows
;
int32_t
numOfCols
=
pQueryAttr
->
pExpr2
?
pQueryAttr
->
numOfExpr2
:
pQueryAttr
->
numOfOutput
;
for
(
int32_t
col
=
0
;
col
<
numOfCols
;
++
col
)
{
SColumnInfoData
*
pColRes
=
taosArrayGet
(
pRes
->
pDataBlock
,
col
);
int32_t
colSize
=
pColRes
->
info
.
bytes
*
numOfRows
;
if
(
NEEDTO_COMPRESS_QUERY
(
colSize
))
{
return
true
;
}
}
return
false
;
}
void
releaseQueryBuf
(
size_t
numOfTables
)
{
if
(
tsQueryBufferSizeBytes
<
0
)
{
return
;
...
...
src/query/src/queryMain.c
浏览文件 @
8a140660
...
...
@@ -357,7 +357,7 @@ int32_t qDumpRetrieveResult(qinfo_t qinfo, SRetrieveTableRsp **pRsp, int32_t *co
}
(
*
pRsp
)
->
precision
=
htons
(
pQueryAttr
->
precision
);
(
*
pRsp
)
->
compressed
=
NEEDTO_COMPRESS_QUERY
(
pQueryAttr
->
resultRowSize
*
s
);
(
*
pRsp
)
->
compressed
=
checkNeedToCompressQueryCol
(
pQInfo
);
if
(
GET_NUM_OF_RESULTS
(
&
(
pQInfo
->
runtimeEnv
))
>
0
&&
pQInfo
->
code
==
TSDB_CODE_SUCCESS
)
{
doDumpQueryResult
(
pQInfo
,
(
*
pRsp
)
->
data
,
(
*
pRsp
)
->
compressed
,
&
compLen
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录