Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
241638de
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,发现更多精彩内容 >>
未验证
提交
241638de
编写于
12月 03, 2022
作者:
S
Shengliang Guan
提交者:
GitHub
12月 03, 2022
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #18661 from taosdata/fix/liao_cov
enh(query): improve the performance and add some todo
上级
b4cb0006
392fe988
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
19 addition
and
11 deletion
+19
-11
source/common/src/tdatablock.c
source/common/src/tdatablock.c
+7
-2
source/libs/executor/src/executil.c
source/libs/executor/src/executil.c
+1
-0
source/libs/scalar/src/scalar.c
source/libs/scalar/src/scalar.c
+1
-4
source/os/src/osMemory.c
source/os/src/osMemory.c
+2
-1
source/util/src/tpagedbuf.c
source/util/src/tpagedbuf.c
+8
-4
未找到文件。
source/common/src/tdatablock.c
浏览文件 @
241638de
...
...
@@ -19,7 +19,7 @@
#include "tlog.h"
#include "tname.h"
#define MALLOC_ALIGN_BYTES
32
#define MALLOC_ALIGN_BYTES
256
int32_t
colDataGetLength
(
const
SColumnInfoData
*
pColumnInfoData
,
int32_t
numOfRows
)
{
ASSERT
(
pColumnInfoData
!=
NULL
);
...
...
@@ -1191,7 +1191,6 @@ static int32_t doEnsureCapacity(SColumnInfoData* pColumn, const SDataBlockInfo*
int32_t
oldLen
=
BitmapLen
(
existedRows
);
pColumn
->
nullbitmap
=
tmp
;
memset
(
&
pColumn
->
nullbitmap
[
oldLen
],
0
,
BitmapLen
(
numOfRows
)
-
oldLen
);
ASSERT
(
pColumn
->
info
.
bytes
);
// make sure the allocated memory is MALLOC_ALIGN_BYTES aligned
...
...
@@ -1207,6 +1206,12 @@ static int32_t doEnsureCapacity(SColumnInfoData* pColumn, const SDataBlockInfo*
}
pColumn
->
pData
=
tmp
;
// todo remove it soon
#if defined LINUX
ASSERT
((((
uint64_t
)
pColumn
->
pData
)
&
(
MALLOC_ALIGN_BYTES
-
1
))
==
0x0
);
#endif
if
(
clearPayload
)
{
memset
(
tmp
+
pColumn
->
info
.
bytes
*
existedRows
,
0
,
pColumn
->
info
.
bytes
*
(
numOfRows
-
existedRows
));
}
...
...
source/libs/executor/src/executil.c
浏览文件 @
241638de
...
...
@@ -129,6 +129,7 @@ void initGroupedResultInfo(SGroupResInfo* pGroupResInfo, SSHashObj* pHashmap, in
void
*
pData
=
NULL
;
pGroupResInfo
->
pRows
=
taosArrayInit
(
10
,
POINTER_BYTES
);
// todo avoid repeated malloc memory
size_t
keyLen
=
0
;
int32_t
iter
=
0
;
while
((
pData
=
tSimpleHashIterate
(
pHashmap
,
pData
,
&
iter
))
!=
NULL
)
{
...
...
source/libs/scalar/src/scalar.c
浏览文件 @
241638de
...
...
@@ -165,10 +165,7 @@ int32_t scalarGenerateSetFromList(void **data, void *pNode, uint32_t type) {
SCL_ERR_JRET
(
TSDB_CODE_OUT_OF_MEMORY
);
}
colDataDestroy
(
out
.
columnData
);
taosMemoryFreeClear
(
out
.
columnData
);
out
.
columnData
=
taosMemoryCalloc
(
1
,
sizeof
(
SColumnInfoData
));
colInfoDataCleanup
(
out
.
columnData
,
out
.
numOfRows
);
cell
=
cell
->
pNext
;
}
...
...
source/os/src/osMemory.c
浏览文件 @
241638de
...
...
@@ -351,7 +351,8 @@ void* taosMemoryMallocAlign(uint32_t alignment, int64_t size) {
ASSERT
(
0
);
#else
#if defined(LINUX)
return
memalign
(
alignment
,
size
);
void
*
p
=
memalign
(
alignment
,
size
);
return
p
;
#else
return
taosMemoryMalloc
(
size
);
#endif
...
...
source/util/src/tpagedbuf.c
浏览文件 @
241638de
...
...
@@ -30,6 +30,7 @@ struct SDiskbasedBuf {
TdFilePtr
pFile
;
int32_t
allocateId
;
// allocated page id
char
*
path
;
// file path
char
*
prefix
;
// file name prefix
int32_t
pageSize
;
// current used page size
int32_t
inMemPages
;
// numOfPages that are allocated in memory
SList
*
freePgList
;
// free page list
...
...
@@ -48,6 +49,12 @@ struct SDiskbasedBuf {
};
static
int32_t
createDiskFile
(
SDiskbasedBuf
*
pBuf
)
{
if
(
pBuf
->
path
==
NULL
)
{
// prepare the file name when needed it
char
path
[
PATH_MAX
]
=
{
0
};
taosGetTmpfilePath
(
pBuf
->
prefix
,
"paged-buf"
,
path
);
pBuf
->
path
=
taosMemoryStrDup
(
path
);
}
pBuf
->
pFile
=
taosOpenFile
(
pBuf
->
path
,
TD_FILE_CREATE
|
TD_FILE_WRITE
|
TD_FILE_READ
|
TD_FILE_TRUNC
|
TD_FILE_AUTO_DEL
);
if
(
pBuf
->
pFile
==
NULL
)
{
...
...
@@ -356,10 +363,7 @@ int32_t createDiskbasedBuf(SDiskbasedBuf** pBuf, int32_t pagesize, int32_t inMem
pPBuf
->
assistBuf
=
taosMemoryMalloc
(
pPBuf
->
pageSize
+
2
);
// EXTRA BYTES
pPBuf
->
all
=
taosHashInit
(
10
,
fn
,
true
,
false
);
char
path
[
PATH_MAX
]
=
{
0
};
taosGetTmpfilePath
(
dir
,
"paged-buf"
,
path
);
pPBuf
->
path
=
strdup
(
path
);
pPBuf
->
prefix
=
(
char
*
)
dir
;
pPBuf
->
emptyDummyIdList
=
taosArrayInit
(
1
,
sizeof
(
int32_t
));
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录