Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
4977e2e6
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看板
提交
4977e2e6
编写于
9月 29, 2022
作者:
dengyihao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
opt tbname in
上级
88ac809f
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
57 addition
and
7 deletion
+57
-7
include/libs/index/index.h
include/libs/index/index.h
+6
-0
source/dnode/mgmt/node_mgmt/src/dmMgmt.c
source/dnode/mgmt/node_mgmt/src/dmMgmt.c
+2
-0
source/libs/executor/src/executil.c
source/libs/executor/src/executil.c
+38
-2
source/libs/index/src/index.c
source/libs/index/src/index.c
+9
-3
source/libs/index/src/indexCache.c
source/libs/index/src/indexCache.c
+1
-1
source/libs/transport/src/transComm.c
source/libs/transport/src/transComm.c
+1
-1
未找到文件。
include/libs/index/index.h
浏览文件 @
4977e2e6
...
...
@@ -225,6 +225,12 @@ typedef enum { SFLT_NOT_INDEX, SFLT_COARSE_INDEX, SFLT_ACCURATE_INDEX } SIdxFltS
SIdxFltStatus
idxGetFltStatus
(
SNode
*
pFilterNode
);
int32_t
doFilterTag
(
SNode
*
pFilterNode
,
SIndexMetaArg
*
metaArg
,
SArray
*
result
,
SIdxFltStatus
*
status
);
/*
* init index env
*
*/
void
indexInit
(
int32_t
threads
);
/*
* destory index env
*
...
...
source/dnode/mgmt/node_mgmt/src/dmMgmt.c
浏览文件 @
4977e2e6
...
...
@@ -193,6 +193,8 @@ int32_t dmInitDnode(SDnode *pDnode, EDndNodeType rtype) {
goto
_OVER
;
}
indexInit
(
tsNumOfCommitThreads
);
dmReportStartup
(
"dnode-transport"
,
"initialized"
);
dDebug
(
"dnode is created, ptr:%p"
,
pDnode
);
code
=
0
;
...
...
source/libs/executor/src/executil.c
浏览文件 @
4977e2e6
...
...
@@ -27,6 +27,7 @@
#include "tcompression.h"
static
int32_t
optimizeTbnameInCond
(
void
*
metaHandle
,
int64_t
suid
,
SArray
*
list
,
SNode
*
pTagCond
);
static
int32_t
optimizeTbnameInCondImpl
(
void
*
metaHandle
,
int64_t
suid
,
SArray
*
list
,
SNode
*
pTagCond
);
void
initResultRowInfo
(
SResultRowInfo
*
pResultRowInfo
)
{
pResultRowInfo
->
size
=
0
;
...
...
@@ -750,7 +751,43 @@ end:
return
code
;
}
static
int32_t
optimizeTbnameInCond
(
void
*
metaHandle
,
int64_t
suid
,
SArray
*
list
,
SNode
*
pTagCond
)
{
static
int
tableUidCompare
(
const
void
*
a
,
const
void
*
b
)
{
uint64_t
u1
=
*
(
uint64_t
*
)
a
;
uint64_t
u2
=
*
(
uint64_t
*
)
b
;
if
(
u1
==
u2
)
{
return
0
;
}
return
u1
<
u2
?
-
1
:
1
;
}
static
int32_t
optimizeTbnameInCond
(
void
*
metaHandle
,
int64_t
suid
,
SArray
*
list
,
SNode
*
cond
)
{
if
(
nodeType
(
cond
)
==
QUERY_NODE_OPERATOR
)
{
return
optimizeTbnameInCondImpl
(
metaHandle
,
suid
,
list
,
cond
);
}
if
(
nodeType
(
cond
)
!=
QUERY_NODE_LOGIC_CONDITION
||
((
SLogicConditionNode
*
)
cond
)
->
condType
!=
LOGIC_COND_TYPE_AND
)
{
return
-
1
;
}
SLogicConditionNode
*
pNode
=
(
SLogicConditionNode
*
)
cond
;
SNodeListNode
*
pList
=
(
SNodeListNode
*
)
pNode
->
pParameterList
;
int32_t
len
=
LIST_LENGTH
(
pList
->
pNodeList
);
bool
hasTbnameCond
=
false
;
if
(
len
<=
0
)
return
-
1
;
SListCell
*
cell
=
pList
->
pNodeList
->
pHead
;
for
(
int
i
=
0
;
i
<
len
;
i
++
)
{
if
(
cell
&&
optimizeTbnameInCondImpl
(
metaHandle
,
suid
,
list
,
cell
->
pNode
)
==
0
)
{
hasTbnameCond
=
true
;
}
cell
=
cell
->
pNext
;
}
taosArraySort
(
list
,
tableUidCompare
);
taosArrayRemoveDuplicate
(
list
,
tableUidCompare
,
NULL
);
return
hasTbnameCond
==
true
?
0
:
-
1
;
}
static
int32_t
optimizeTbnameInCondImpl
(
void
*
metaHandle
,
int64_t
suid
,
SArray
*
list
,
SNode
*
pTagCond
)
{
if
(
nodeType
(
pTagCond
)
!=
QUERY_NODE_OPERATOR
)
{
return
-
1
;
}
...
...
@@ -777,7 +814,6 @@ static int32_t optimizeTbnameInCond(void* metaHandle, int64_t suid, SArray* list
}
char
*
name
=
varDataVal
(
valueNode
->
datum
.
p
);
taosArrayPush
(
pTbList
,
&
name
);
cell
=
cell
->
pNext
;
}
...
...
source/libs/index/src/index.c
浏览文件 @
4977e2e6
...
...
@@ -54,11 +54,17 @@
void
*
indexQhandle
=
NULL
;
int32_t
indexRefMgt
;
int32_t
indexThreads
=
5
;
static
void
indexDestroy
(
void
*
sIdx
);
void
indexInit
()
{
void
indexInit
(
int32_t
threadNum
)
{
indexThreads
=
threadNum
;
if
(
indexThreads
<=
1
)
indexThreads
=
INDEX_NUM_OF_THREADS
;
}
void
indexEnvInit
()
{
// refactor later
indexQhandle
=
taosInitScheduler
(
INDEX_QUEUE_SIZE
,
INDEX_NUM_OF_THREADS
,
"index"
,
NULL
);
indexQhandle
=
taosInitScheduler
(
INDEX_QUEUE_SIZE
,
indexThreads
,
"index"
,
NULL
);
indexRefMgt
=
taosOpenRef
(
1000
,
indexDestroy
);
}
void
indexCleanup
()
{
...
...
@@ -99,7 +105,7 @@ static void indexWait(void* idx) {
int
indexOpen
(
SIndexOpts
*
opts
,
const
char
*
path
,
SIndex
**
index
)
{
int
ret
=
TSDB_CODE_SUCCESS
;
taosThreadOnce
(
&
isInit
,
indexInit
);
taosThreadOnce
(
&
isInit
,
index
Env
Init
);
SIndex
*
idx
=
taosMemoryCalloc
(
1
,
sizeof
(
SIndex
));
if
(
idx
==
NULL
)
{
return
TSDB_CODE_OUT_OF_MEMORY
;
...
...
source/libs/index/src/indexCache.c
浏览文件 @
4977e2e6
...
...
@@ -22,7 +22,7 @@
#define MAX_INDEX_KEY_LEN 256 // test only, change later
#define MEM_TERM_LIMIT 10 * 10000
#define MEM_THRESHOLD
512 * 1024
#define MEM_THRESHOLD
8 * 512 * 1024 // 8M
#define MEM_SIGNAL_QUIT MEM_THRESHOLD * 20
#define MEM_ESTIMATE_RADIO 1.5
...
...
source/libs/transport/src/transComm.c
浏览文件 @
4977e2e6
...
...
@@ -193,7 +193,7 @@ bool transReadComplete(SConnBuffer* connBuf) {
int
transSetConnOption
(
uv_tcp_t
*
stream
)
{
uv_tcp_nodelay
(
stream
,
1
);
int
ret
=
uv_tcp_keepalive
(
stream
,
5
,
5
);
int
ret
=
uv_tcp_keepalive
(
stream
,
5
,
60
);
return
ret
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录