提交 22512c09 编写于 作者: C Cary Xu

enh: row optimization

上级 2b06d832
...@@ -150,8 +150,8 @@ typedef struct { ...@@ -150,8 +150,8 @@ typedef struct {
void *pBitmap; void *pBitmap;
void *pOffset; void *pOffset;
int32_t extendedRowSize; int32_t extendedRowSize;
int16_t nNone; bool hasNone;
int16_t nNull; bool hasNull;
} SRowBuilder; } SRowBuilder;
#define TD_ROW_HEAD_LEN (sizeof(STSRow)) #define TD_ROW_HEAD_LEN (sizeof(STSRow))
...@@ -292,7 +292,7 @@ int32_t tdSRowSetExtendedInfo(SRowBuilder *pBuilder, int32_t nCols, int32_t nBou ...@@ -292,7 +292,7 @@ int32_t tdSRowSetExtendedInfo(SRowBuilder *pBuilder, int32_t nCols, int32_t nBou
int32_t tdSRowResetBuf(SRowBuilder *pBuilder, void *pBuf); int32_t tdSRowResetBuf(SRowBuilder *pBuilder, void *pBuf);
static FORCE_INLINE void tdSRowEnd(SRowBuilder *pBuilder) { static FORCE_INLINE void tdSRowEnd(SRowBuilder *pBuilder) {
STSRow *pRow = (STSRow *)pBuilder->pBuf; STSRow *pRow = (STSRow *)pBuilder->pBuf;
if (pBuilder->nNone || pBuilder->nNull) { if (pBuilder->hasNull || pBuilder->hasNone) {
pRow->statis = 1; pRow->statis = 1;
} }
} }
......
...@@ -925,10 +925,10 @@ int32_t tdAppendColValToRow(SRowBuilder *pBuilder, col_id_t colId, int8_t colTyp ...@@ -925,10 +925,10 @@ int32_t tdAppendColValToRow(SRowBuilder *pBuilder, col_id_t colId, int8_t colTyp
case TD_VTYPE_NORM: case TD_VTYPE_NORM:
break; break;
case TD_VTYPE_NULL: case TD_VTYPE_NULL:
++pBuilder->nNull; if (!pBuilder->hasNull) pBuilder->hasNull = true;
break; break;
case TD_VTYPE_NONE: case TD_VTYPE_NONE:
++pBuilder->nNone; if (!pBuilder->hasNone) pBuilder->hasNone = true;
break; break;
default: default:
ASSERT(0); ASSERT(0);
...@@ -1102,10 +1102,9 @@ int32_t tdSRowResetBuf(SRowBuilder *pBuilder, void *pBuf) { ...@@ -1102,10 +1102,9 @@ int32_t tdSRowResetBuf(SRowBuilder *pBuilder, void *pBuf) {
return terrno; return terrno;
} }
if (pBuilder->nNone) pBuilder->nNone = 0; if (pBuilder->hasNone) pBuilder->hasNone = false;
if (pBuilder->nNull) pBuilder->nNull = 0; if (pBuilder->hasNull) pBuilder->hasNull = false;
pBuilder->nNull = 0;
TD_ROW_SET_INFO(pBuilder->pBuf, 0); TD_ROW_SET_INFO(pBuilder->pBuf, 0);
TD_ROW_SET_TYPE(pBuilder->pBuf, pBuilder->rowType); TD_ROW_SET_TYPE(pBuilder->pBuf, pBuilder->rowType);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册