Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
e9490a32
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看板
提交
e9490a32
编写于
2月 02, 2023
作者:
H
Haojun Liao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
refactor(query): disable tag filter cache by default.
上级
edca89b7
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
60 addition
and
50 deletion
+60
-50
include/os/osEnv.h
include/os/osEnv.h
+1
-0
source/common/src/tglobal.c
source/common/src/tglobal.c
+3
-0
source/dnode/vnode/src/tsdb/tsdbRead.c
source/dnode/vnode/src/tsdb/tsdbRead.c
+42
-42
source/libs/executor/src/executil.c
source/libs/executor/src/executil.c
+14
-8
未找到文件。
include/os/osEnv.h
浏览文件 @
e9490a32
...
...
@@ -41,6 +41,7 @@ extern char tsSSE42Enable;
extern
char
tsAVXEnable
;
extern
char
tsAVX2Enable
;
extern
char
tsFMAEnable
;
extern
char
tsTagFilterCache
;
extern
char
configDir
[];
extern
char
tsDataDir
[];
...
...
source/common/src/tglobal.c
浏览文件 @
e9490a32
...
...
@@ -140,6 +140,7 @@ int32_t tsMaxMemUsedByInsert = 1024;
float
tsSelectivityRatio
=
1
.
0
;
int32_t
tsTagFilterResCacheSize
=
1024
*
10
;
char
tsTagFilterCache
=
0
;
// the maximum allowed query buffer size during query processing for each data node.
// -1 no limit (default)
...
...
@@ -351,6 +352,7 @@ static int32_t taosAddSystemCfg(SConfig *pCfg) {
if
(
cfgAddBool
(
pCfg
,
"AVX2"
,
tsAVX2Enable
,
0
)
!=
0
)
return
-
1
;
if
(
cfgAddBool
(
pCfg
,
"FMA"
,
tsFMAEnable
,
0
)
!=
0
)
return
-
1
;
if
(
cfgAddBool
(
pCfg
,
"SIMD-builtins"
,
tsSIMDBuiltins
,
0
)
!=
0
)
return
-
1
;
if
(
cfgAddBool
(
pCfg
,
"tagFilterCache"
,
tsTagFilterCache
,
0
)
!=
0
)
return
-
1
;
if
(
cfgAddInt64
(
pCfg
,
"openMax"
,
tsOpenMax
,
0
,
INT64_MAX
,
1
)
!=
0
)
return
-
1
;
if
(
cfgAddInt64
(
pCfg
,
"streamMax"
,
tsStreamMax
,
0
,
INT64_MAX
,
1
)
!=
0
)
return
-
1
;
...
...
@@ -731,6 +733,7 @@ static int32_t taosSetServerCfg(SConfig *pCfg) {
tsRpcQueueMemoryAllowed
=
cfgGetItem
(
pCfg
,
"rpcQueueMemoryAllowed"
)
->
i64
;
tsSIMDBuiltins
=
(
bool
)
cfgGetItem
(
pCfg
,
"SIMD-builtins"
)
->
bval
;
tsTagFilterCache
=
(
bool
)
cfgGetItem
(
pCfg
,
"tagFilterCache"
)
->
bval
;
tsEnableMonitor
=
cfgGetItem
(
pCfg
,
"monitor"
)
->
bval
;
tsMonitorInterval
=
cfgGetItem
(
pCfg
,
"monitorInterval"
)
->
i32
;
...
...
source/dnode/vnode/src/tsdb/tsdbRead.c
浏览文件 @
e9490a32
...
...
@@ -2745,48 +2745,48 @@ static void resetScanBlockLastBlockDelIndex(SReaderStatus* pStatus, int32_t orde
}
}
static
int32_t
initOrderCheckInfo
(
SUidOrderedList
*
pOrderCheckInfo
,
STsdbReader
*
pReader
)
{
SReaderStatus
*
pStatus
=
&
pReader
->
status
;
int32_t
total
=
taosHashGetSize
(
pStatus
->
pTableMap
);
if
(
total
==
0
)
{
return
TSDB_CODE_SUCCESS
;
}
if
(
pOrderCheckInfo
->
tableUidList
==
NULL
)
{
pOrderCheckInfo
->
currentIndex
=
0
;
pOrderCheckInfo
->
tableUidList
=
taosMemoryMalloc
(
total
*
sizeof
(
uint64_t
));
if
(
pOrderCheckInfo
->
tableUidList
==
NULL
)
{
return
TSDB_CODE_OUT_OF_MEMORY
;
}
extractOrderedTableUidList
(
pOrderCheckInfo
,
pStatus
,
pReader
->
order
);
uint64_t
uid
=
pOrderCheckInfo
->
tableUidList
[
0
];
pStatus
->
pTableIter
=
taosHashGet
(
pStatus
->
pTableMap
,
&
uid
,
sizeof
(
uid
));
}
else
{
if
(
pStatus
->
pTableIter
==
NULL
)
{
// it is the last block of a new file
pOrderCheckInfo
->
currentIndex
=
0
;
uint64_t
uid
=
pOrderCheckInfo
->
tableUidList
[
pOrderCheckInfo
->
currentIndex
];
pStatus
->
pTableIter
=
taosHashGet
(
pStatus
->
pTableMap
,
&
uid
,
sizeof
(
uid
));
// the tableMap has already updated, let's also update the order list
if
(
pStatus
->
pTableIter
==
NULL
)
{
void
*
p
=
taosMemoryRealloc
(
pOrderCheckInfo
->
tableUidList
,
total
*
sizeof
(
uint64_t
));
if
(
p
==
NULL
)
{
return
TSDB_CODE_OUT_OF_MEMORY
;
}
pOrderCheckInfo
->
tableUidList
=
p
;
extractOrderedTableUidList
(
pOrderCheckInfo
,
pStatus
,
pReader
->
order
);
uid
=
pOrderCheckInfo
->
tableUidList
[
0
];
pStatus
->
pTableIter
=
taosHashGet
(
pStatus
->
pTableMap
,
&
uid
,
sizeof
(
uid
));
}
}
}
return
TSDB_CODE_SUCCESS
;
}
//
static int32_t initOrderCheckInfo(SUidOrderedList* pOrderCheckInfo, STsdbReader* pReader) {
//
SReaderStatus* pStatus = &pReader->status;
//
//
int32_t total = taosHashGetSize(pStatus->pTableMap);
//
if (total == 0) {
//
return TSDB_CODE_SUCCESS;
//
}
//
//
if (pOrderCheckInfo->tableUidList == NULL) {
//
pOrderCheckInfo->currentIndex = 0;
//
pOrderCheckInfo->tableUidList = taosMemoryMalloc(total * sizeof(uint64_t));
//
if (pOrderCheckInfo->tableUidList == NULL) {
//
return TSDB_CODE_OUT_OF_MEMORY;
//
}
//
//
extractOrderedTableUidList(pOrderCheckInfo, pStatus, pReader->order);
//
uint64_t uid = pOrderCheckInfo->tableUidList[0];
//
pStatus->pTableIter = taosHashGet(pStatus->pTableMap, &uid, sizeof(uid));
//
} else {
//
if (pStatus->pTableIter == NULL) { // it is the last block of a new file
//
pOrderCheckInfo->currentIndex = 0;
//
uint64_t uid = pOrderCheckInfo->tableUidList[pOrderCheckInfo->currentIndex];
//
pStatus->pTableIter = taosHashGet(pStatus->pTableMap, &uid, sizeof(uid));
//
//
// the tableMap has already updated, let's also update the order list
//
if (pStatus->pTableIter == NULL) {
//
void* p = taosMemoryRealloc(pOrderCheckInfo->tableUidList, total * sizeof(uint64_t));
//
if (p == NULL) {
//
return TSDB_CODE_OUT_OF_MEMORY;
//
}
//
//
pOrderCheckInfo->tableUidList = p;
//
extractOrderedTableUidList(pOrderCheckInfo, pStatus, pReader->order);
//
//
uid = pOrderCheckInfo->tableUidList[0];
//
pStatus->pTableIter = taosHashGet(pStatus->pTableMap, &uid, sizeof(uid));
//
}
//
}
//
}
//
//
return TSDB_CODE_SUCCESS;
//
}
static
void
resetTableListIndex
(
SReaderStatus
*
pStatus
)
{
SUidOrderedList
*
pList
=
&
pStatus
->
uidCheckInfo
;
...
...
source/libs/executor/src/executil.c
浏览文件 @
e9490a32
...
...
@@ -1074,15 +1074,19 @@ int32_t getTableList(void* metaHandle, void* pVnode, SScanPhysiNode* pScanNode,
return
code
;
}
}
else
{
// try to retrieve the result from meta cache
T_MD5_CTX
context
=
{
0
};
genTagFilterDigest
(
pTagCond
,
&
context
);
bool
acquired
=
false
;
metaGetCachedTableUidList
(
metaHandle
,
pScanNode
->
suid
,
context
.
digest
,
tListLen
(
context
.
digest
),
res
,
&
acquired
);
if
(
acquired
)
{
qDebug
(
"retrieve table uid list from cache, numOfTables:%d"
,
(
int32_t
)
taosArrayGetSize
(
res
));
goto
_end
;
if
(
tsTagFilterCache
)
{
// try to retrieve the result from meta cache
genTagFilterDigest
(
pTagCond
,
&
context
);
bool
acquired
=
false
;
metaGetCachedTableUidList
(
metaHandle
,
pScanNode
->
suid
,
context
.
digest
,
tListLen
(
context
.
digest
),
res
,
&
acquired
);
if
(
acquired
)
{
qDebug
(
"retrieve table uid list from cache, numOfTables:%d"
,
(
int32_t
)
taosArrayGetSize
(
res
));
goto
_end
;
}
}
if
(
!
pTagCond
)
{
// no tag filter condition exists, let's fetch all tables of this super table
...
...
@@ -1118,7 +1122,9 @@ int32_t getTableList(void* metaHandle, void* pVnode, SScanPhysiNode* pScanNode,
memcpy
(
pPayload
+
sizeof
(
int32_t
),
taosArrayGet
(
res
,
0
),
numOfTables
*
sizeof
(
uint64_t
));
}
metaUidFilterCachePut
(
metaHandle
,
pScanNode
->
suid
,
context
.
digest
,
tListLen
(
context
.
digest
),
pPayload
,
size
,
1
);
if
(
tsTagFilterCache
)
{
metaUidFilterCachePut
(
metaHandle
,
pScanNode
->
suid
,
context
.
digest
,
tListLen
(
context
.
digest
),
pPayload
,
size
,
1
);
}
}
_end:
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录