From e83159f0d97e08d2c0e001d2dae22388982e20ea Mon Sep 17 00:00:00 2001 From: Haojun Liao Date: Thu, 3 Nov 2022 10:47:55 +0800 Subject: [PATCH] refactor: increase the buffer for each agg operator, and make the pointer attributes in SColumnInfoData to be aligned to 8bit in memory to speedup the execution of memmove & memset. --- include/common/tcommon.h | 6 +++--- source/libs/executor/src/executorimpl.c | 4 +++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/include/common/tcommon.h b/include/common/tcommon.h index 3bfbb85958..674bdcf171 100644 --- a/include/common/tcommon.h +++ b/include/common/tcommon.h @@ -225,13 +225,13 @@ typedef struct SVarColAttr { // pBlockAgg->numOfNull == info.rows, all data are null // pBlockAgg->numOfNull == 0, no data are null. typedef struct SColumnInfoData { - SColumnInfo info; // column info - bool hasNull; // if current column data has null value. - char* pData; // the corresponding block data in memory + char* pData; // the corresponding block data in memory union { char* nullbitmap; // bitmap, one bit for each item in the list SVarColAttr varmeta; }; + SColumnInfo info; // column info + bool hasNull; // if current column data has null value. } SColumnInfoData; typedef struct SQueryTableDataCond { diff --git a/source/libs/executor/src/executorimpl.c b/source/libs/executor/src/executorimpl.c index 13a3712f0c..59266716e1 100644 --- a/source/libs/executor/src/executorimpl.c +++ b/source/libs/executor/src/executorimpl.c @@ -2783,8 +2783,10 @@ int32_t getBufferPgSize(int32_t rowSize, uint32_t* defaultPgsz, uint32_t* defaul *defaultPgsz <<= 1u; } + // The default buffer for each operator in query is 10MB. // at least four pages need to be in buffer - *defaultBufsz = 4096 * 256; + // TODO: make this variable to be configurable. + *defaultBufsz = 4096 * 2560; if ((*defaultBufsz) <= (*defaultPgsz)) { (*defaultBufsz) = (*defaultPgsz) * 4; }