Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
d371c840
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22016
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
d371c840
编写于
10月 31, 2020
作者:
H
Haojun Liao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[TD-225] add logs.
上级
a0ccfd31
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
23 addition
and
13 deletion
+23
-13
src/query/inc/qExecutor.h
src/query/inc/qExecutor.h
+1
-0
src/query/src/qExecutor.c
src/query/src/qExecutor.c
+9
-9
src/query/src/qUtil.c
src/query/src/qUtil.c
+3
-3
src/util/inc/hash.h
src/util/inc/hash.h
+2
-1
src/util/src/hash.c
src/util/src/hash.c
+8
-0
未找到文件。
src/query/inc/qExecutor.h
浏览文件 @
d371c840
...
...
@@ -124,6 +124,7 @@ typedef struct SQueryCostInfo {
uint64_t
firstStageMergeTime
;
uint64_t
winInfoSize
;
uint64_t
tableInfoSize
;
uint64_t
hashSize
;
uint64_t
numOfTimeWindows
;
}
SQueryCostInfo
;
...
...
src/query/src/qExecutor.c
浏览文件 @
d371c840
...
...
@@ -461,16 +461,16 @@ static SWindowResult *doSetTimeWindowFromKey(SQueryRuntimeEnv *pRuntimeEnv, SWin
// more than the capacity, reallocate the resources
if
(
pWindowResInfo
->
size
>=
pWindowResInfo
->
capacity
)
{
int64_t
newCap
=
0
;
int64_t
newCap
acity
=
0
;
if
(
pWindowResInfo
->
capacity
>
10000
)
{
newCap
=
(
int64_t
)(
pWindowResInfo
->
capacity
*
1
.
25
);
newCap
acity
=
(
int64_t
)(
pWindowResInfo
->
capacity
*
1
.
25
);
}
else
{
newCap
=
(
int64_t
)(
pWindowResInfo
->
capacity
*
1
.
5
);
newCap
acity
=
(
int64_t
)(
pWindowResInfo
->
capacity
*
1
.
5
);
}
char
*
t
=
realloc
(
pWindowResInfo
->
pResult
,
(
size_t
)(
newCap
*
sizeof
(
SWindowResult
)));
pRuntimeEnv
->
summary
.
winInfoSize
+=
(
newCap
-
pWindowResInfo
->
capacity
)
*
sizeof
(
SWindowResult
);
pRuntimeEnv
->
summary
.
numOfTimeWindows
+=
(
newCap
-
pWindowResInfo
->
capacity
);
char
*
t
=
realloc
(
pWindowResInfo
->
pResult
,
(
size_t
)(
newCap
acity
*
sizeof
(
SWindowResult
)));
pRuntimeEnv
->
summary
.
winInfoSize
+=
(
newCap
acity
-
pWindowResInfo
->
capacity
)
*
sizeof
(
SWindowResult
);
pRuntimeEnv
->
summary
.
numOfTimeWindows
+=
(
newCap
acity
-
pWindowResInfo
->
capacity
);
if
(
t
==
NULL
)
{
longjmp
(
pRuntimeEnv
->
env
,
TSDB_CODE_QRY_OUT_OF_MEMORY
);
...
...
@@ -478,19 +478,19 @@ static SWindowResult *doSetTimeWindowFromKey(SQueryRuntimeEnv *pRuntimeEnv, SWin
pWindowResInfo
->
pResult
=
(
SWindowResult
*
)
t
;
int32_t
inc
=
(
int32_t
)
newCap
-
pWindowResInfo
->
capacity
;
int32_t
inc
=
(
int32_t
)
newCap
acity
-
pWindowResInfo
->
capacity
;
memset
(
&
pWindowResInfo
->
pResult
[
pWindowResInfo
->
capacity
],
0
,
sizeof
(
SWindowResult
)
*
inc
);
pRuntimeEnv
->
summary
.
winInfoSize
+=
(
pQuery
->
numOfOutput
*
sizeof
(
SResultInfo
)
+
pRuntimeEnv
->
interBufSize
)
*
inc
;
for
(
int32_t
i
=
pWindowResInfo
->
capacity
;
i
<
newCap
;
++
i
)
{
for
(
int32_t
i
=
pWindowResInfo
->
capacity
;
i
<
newCap
acity
;
++
i
)
{
int32_t
ret
=
createQueryResultInfo
(
pQuery
,
&
pWindowResInfo
->
pResult
[
i
],
pRuntimeEnv
->
stableQuery
,
pRuntimeEnv
->
interBufSize
);
if
(
ret
!=
TSDB_CODE_SUCCESS
)
{
longjmp
(
pRuntimeEnv
->
env
,
TSDB_CODE_QRY_OUT_OF_MEMORY
);
}
}
pWindowResInfo
->
capacity
=
(
int32_t
)
newCap
;
pWindowResInfo
->
capacity
=
(
int32_t
)
newCap
acity
;
}
// add a new result set for a new group
...
...
src/query/src/qUtil.c
浏览文件 @
d371c840
...
...
@@ -49,16 +49,16 @@ int32_t initWindowResInfo(SWindowResInfo *pWindowResInfo, SQueryRuntimeEnv *pRun
SQueryCostInfo
*
pSummary
=
&
pRuntimeEnv
->
summary
;
// use the pointer arraylist
pWindowResInfo
->
pResult
=
calloc
(
threshold
,
sizeof
(
SWindowResult
));
pWindowResInfo
->
pResult
=
calloc
(
pWindowResInfo
->
capacity
,
sizeof
(
SWindowResult
));
if
(
pWindowResInfo
->
pResult
==
NULL
)
{
return
TSDB_CODE_QRY_OUT_OF_MEMORY
;
}
pWindowResInfo
->
interval
=
pRuntimeEnv
->
pQuery
->
interval
.
interval
;
pSummary
->
winInfoSize
+=
sizeof
(
SWindowResult
)
*
threshold
;
pSummary
->
winInfoSize
+=
sizeof
(
SWindowResult
)
*
pWindowResInfo
->
capacity
;
pSummary
->
winInfoSize
+=
(
pRuntimeEnv
->
pQuery
->
numOfOutput
*
sizeof
(
SResultInfo
)
+
pRuntimeEnv
->
interBufSize
)
*
pWindowResInfo
->
capacity
;
pSummary
->
numOfTimeWindows
=
threshold
;
pSummary
->
numOfTimeWindows
=
pWindowResInfo
->
capacity
;
for
(
int32_t
i
=
0
;
i
<
pWindowResInfo
->
capacity
;
++
i
)
{
int32_t
code
=
createQueryResultInfo
(
pRuntimeEnv
->
pQuery
,
&
pWindowResInfo
->
pResult
[
i
],
pRuntimeEnv
->
stableQuery
,
pRuntimeEnv
->
interBufSize
);
...
...
src/util/inc/hash.h
浏览文件 @
d371c840
...
...
@@ -32,7 +32,6 @@ typedef void (*_hash_free_fn_t)(void *param);
typedef
struct
SHashNode
{
char
*
key
;
// struct SHashNode *prev;
struct
SHashNode
*
next
;
uint32_t
hashVal
;
// the hash value of key, if hashVal == HASH_VALUE_IN_TRASH, this node is moved to trash
uint32_t
keyLen
;
// length of the key
...
...
@@ -175,6 +174,8 @@ void* taosHashDestroyIter(SHashMutableIterator* iter);
*/
int32_t
taosHashGetMaxOverflowLinkLength
(
const
SHashObj
*
pHashObj
);
size_t
taosHashGetMemSize
(
const
SHashObj
*
pHashObj
);
#ifdef __cplusplus
}
#endif
...
...
src/util/src/hash.c
浏览文件 @
d371c840
...
...
@@ -798,3 +798,11 @@ SHashNode *getNextHashNode(SHashMutableIterator *pIter) {
return
NULL
;
}
size_t
taosHashGetMemSize
(
const
SHashObj
*
pHashObj
)
{
if
(
pHashObj
==
NULL
)
{
return
0
;
}
return
(
pHashObj
->
capacity
*
sizeof
(
SHashEntry
)
+
POINTER_BYTES
)
+
sizeof
(
SHashNode
)
*
taosHashGetSize
(
pHashObj
);
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录