Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
50bba139
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1187
Star
22018
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看板
提交
50bba139
编写于
4月 29, 2022
作者:
C
Cary Xu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat: bsma logic optimization
上级
3d0fc140
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
15 addition
and
13 deletion
+15
-13
include/common/tdataformat.h
include/common/tdataformat.h
+4
-4
include/common/tmsg.h
include/common/tmsg.h
+3
-1
source/common/src/tdataformat.c
source/common/src/tdataformat.c
+6
-6
source/dnode/vnode/src/tsdb/tsdbCommit.c
source/dnode/vnode/src/tsdb/tsdbCommit.c
+1
-1
source/dnode/vnode/src/tsdb/tsdbRead.c
source/dnode/vnode/src/tsdb/tsdbRead.c
+1
-1
未找到文件。
include/common/tdataformat.h
浏览文件 @
50bba139
...
...
@@ -64,19 +64,19 @@ typedef struct {
col_id_t
colId
;
// column ID(start from PRIMARYKEY_TIMESTAMP_COL_ID(1))
int32_t
type
:
8
;
// column type
int32_t
bytes
:
24
;
// column bytes (0~16M)
int32_t
sma
:
8
;
// block SMA: 0, no SMA, 1, sum/min/max, 2, ...
int32_t
flags
:
8
;
// flags: 0 no index, 1 SCHEMA_SMA_ON, 2 SCHEMA_IDX_ON
int32_t
offset
:
24
;
// point offset in STpRow after the header part.
}
STColumn
;
#pragma pack(pop)
#define colType(col) ((col)->type)
#define col
Sma(col) ((col)->sma
)
#define col
Flags(col) ((col)->flags
)
#define colColId(col) ((col)->colId)
#define colBytes(col) ((col)->bytes)
#define colOffset(col) ((col)->offset)
#define colSetType(col, t) (colType(col) = (t))
#define colSet
Sma(col, s) (colSma(col) = (s
))
#define colSet
Flags(col, f) (colFlags(col) = (f
))
#define colSetColId(col, id) (colColId(col) = (id))
#define colSetBytes(col, b) (colBytes(col) = (b))
#define colSetOffset(col, o) (colOffset(col) = (o))
...
...
@@ -146,7 +146,7 @@ typedef struct {
int32_t
tdInitTSchemaBuilder
(
STSchemaBuilder
*
pBuilder
,
schema_ver_t
version
);
void
tdDestroyTSchemaBuilder
(
STSchemaBuilder
*
pBuilder
);
void
tdResetTSchemaBuilder
(
STSchemaBuilder
*
pBuilder
,
schema_ver_t
version
);
int32_t
tdAddColToSchema
(
STSchemaBuilder
*
pBuilder
,
int8_t
type
,
int8_t
sma
,
col_id_t
colId
,
col_bytes_t
bytes
);
int32_t
tdAddColToSchema
(
STSchemaBuilder
*
pBuilder
,
int8_t
type
,
int8_t
flags
,
col_id_t
colId
,
col_bytes_t
bytes
);
STSchema
*
tdGetSchemaFromBuilder
(
STSchemaBuilder
*
pBuilder
);
// ----------------- Semantic timestamp key definition
...
...
include/common/tmsg.h
浏览文件 @
50bba139
...
...
@@ -281,8 +281,10 @@ typedef struct SSchema {
char
name
[
TSDB_COL_NAME_LEN
];
}
SSchema
;
#define IS_BSMA_ON(s) (((s)->flags & 0x01) == SCHEMA_SMA_ON)
#define SSCHMEA_TYPE(s) ((s)->type)
#define SSCHMEA_
SMA(s) ((s)->sma
)
#define SSCHMEA_
FLAGS(s) ((s)->flags
)
#define SSCHMEA_COLID(s) ((s)->colId)
#define SSCHMEA_BYTES(s) ((s)->bytes)
#define SSCHMEA_NAME(s) ((s)->name)
...
...
source/common/src/tdataformat.c
浏览文件 @
50bba139
...
...
@@ -87,7 +87,7 @@ int tdEncodeSchema(void **buf, STSchema *pSchema) {
for
(
int
i
=
0
;
i
<
schemaNCols
(
pSchema
);
i
++
)
{
STColumn
*
pCol
=
schemaColAt
(
pSchema
,
i
);
tlen
+=
taosEncodeFixedI8
(
buf
,
colType
(
pCol
));
tlen
+=
taosEncodeFixedI8
(
buf
,
col
Sma
(
pCol
));
tlen
+=
taosEncodeFixedI8
(
buf
,
col
Flags
(
pCol
));
tlen
+=
taosEncodeFixedI16
(
buf
,
colColId
(
pCol
));
tlen
+=
taosEncodeFixedI16
(
buf
,
colBytes
(
pCol
));
}
...
...
@@ -110,14 +110,14 @@ void *tdDecodeSchema(void *buf, STSchema **pRSchema) {
for
(
int
i
=
0
;
i
<
numOfCols
;
i
++
)
{
col_type_t
type
=
0
;
int8_t
sma
=
0
;
int8_t
flags
=
0
;
col_id_t
colId
=
0
;
col_bytes_t
bytes
=
0
;
buf
=
taosDecodeFixedI8
(
buf
,
&
type
);
buf
=
taosDecodeFixedI8
(
buf
,
&
sma
);
buf
=
taosDecodeFixedI8
(
buf
,
&
flags
);
buf
=
taosDecodeFixedI16
(
buf
,
&
colId
);
buf
=
taosDecodeFixedI32
(
buf
,
&
bytes
);
if
(
tdAddColToSchema
(
&
schemaBuilder
,
type
,
sma
,
colId
,
bytes
)
<
0
)
{
if
(
tdAddColToSchema
(
&
schemaBuilder
,
type
,
flags
,
colId
,
bytes
)
<
0
)
{
tdDestroyTSchemaBuilder
(
&
schemaBuilder
);
return
NULL
;
}
...
...
@@ -153,7 +153,7 @@ void tdResetTSchemaBuilder(STSchemaBuilder *pBuilder, schema_ver_t version) {
pBuilder
->
version
=
version
;
}
int32_t
tdAddColToSchema
(
STSchemaBuilder
*
pBuilder
,
int8_t
type
,
int8_t
sma
,
col_id_t
colId
,
col_bytes_t
bytes
)
{
int32_t
tdAddColToSchema
(
STSchemaBuilder
*
pBuilder
,
int8_t
type
,
int8_t
flags
,
col_id_t
colId
,
col_bytes_t
bytes
)
{
if
(
!
isValidDataType
(
type
))
return
-
1
;
if
(
pBuilder
->
nCols
>=
pBuilder
->
tCols
)
{
...
...
@@ -166,7 +166,7 @@ int32_t tdAddColToSchema(STSchemaBuilder *pBuilder, int8_t type, int8_t sma, col
STColumn
*
pCol
=
&
(
pBuilder
->
columns
[
pBuilder
->
nCols
]);
colSetType
(
pCol
,
type
);
colSetColId
(
pCol
,
colId
);
colSet
Sma
(
pCol
,
sma
);
colSet
Flags
(
pCol
,
flags
);
if
(
pBuilder
->
nCols
==
0
)
{
colSetOffset
(
pCol
,
0
);
}
else
{
...
...
source/dnode/vnode/src/tsdb/tsdbCommit.c
浏览文件 @
50bba139
...
...
@@ -935,7 +935,7 @@ int tsdbWriteBlockImpl(STsdb *pRepo, STable *pTable, SDFile *pDFile, SDFile *pDF
pBlockCol
->
type
=
pDataCol
->
type
;
pAggrBlkCol
->
colId
=
pDataCol
->
colId
;
if
(
isSuper
&&
pColumn
->
sma
&&
tDataTypes
[
pDataCol
->
type
].
statisFunc
)
{
if
(
isSuper
&&
IS_BSMA_ON
(
pColumn
)
&&
tDataTypes
[
pDataCol
->
type
].
statisFunc
)
{
#if 0
(*tDataTypes[pDataCol->type].statisFunc)(pDataCol->pData, rowsToWrite, &(pBlockCol->min), &(pBlockCol->max),
&(pBlockCol->sum), &(pBlockCol->minIndex), &(pBlockCol->maxIndex),
...
...
source/dnode/vnode/src/tsdb/tsdbRead.c
浏览文件 @
50bba139
...
...
@@ -3330,7 +3330,7 @@ int32_t tsdbRetrieveDataBlockStatisInfo(tsdbReaderT* pTsdbReadHandle, SColumnDat
int32_t
*
slotIds
=
pHandle
->
suppInfo
.
slotIds
;
for
(
int32_t
i
=
1
;
i
<
numOfCols
;
++
i
)
{
ASSERT
(
colIds
[
i
]
==
pHandle
->
pSchema
->
columns
[
slotIds
[
i
]].
colId
);
if
(
pHandle
->
pSchema
->
columns
[
slotIds
[
i
]].
sma
)
{
if
(
IS_BSMA_ON
(
&
(
pHandle
->
pSchema
->
columns
[
slotIds
[
i
]]))
)
{
if
(
pHandle
->
suppInfo
.
pstatis
[
i
].
numOfNull
==
-
1
)
{
// set the column data are all NULL
pHandle
->
suppInfo
.
pstatis
[
i
].
numOfNull
=
pBlockInfo
->
compBlock
->
numOfRows
;
}
else
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录