[TD-5623]<feature>: Added Global config 'CompressColDaata' to
enable/disable col compression. Default to 0.
This commit is contained in:
parent
8eb1af221f
commit
5e631fc86f
|
@ -60,6 +60,7 @@ extern char tsLocale[];
|
|||
extern char tsCharset[]; // default encode string
|
||||
extern int8_t tsEnableCoreFile;
|
||||
extern int32_t tsCompressMsgSize;
|
||||
extern int32_t tsCompressColData;
|
||||
extern int32_t tsMaxNumOfDistinctResults;
|
||||
extern char tsTempDir[];
|
||||
|
||||
|
|
|
@ -75,6 +75,14 @@ int32_t tsMaxBinaryDisplayWidth = 30;
|
|||
*/
|
||||
int32_t tsCompressMsgSize = -1;
|
||||
|
||||
/* denote if server needs to compress the retrieved column data before adding to the rpc response message body.
|
||||
* 0: disable column data compression
|
||||
* 1: enable column data compression
|
||||
* This option is default to disabled. Once enabled, compression will be conducted if any column has size more
|
||||
* than QUERY_COMP_THRESHOLD. Otherwise, no further compression is needed.
|
||||
*/
|
||||
int32_t tsCompressColData = 0;
|
||||
|
||||
// client
|
||||
int32_t tsMaxSQLStringLen = TSDB_MAX_ALLOWED_SQL_LEN;
|
||||
int32_t tsMaxWildCardsLen = TSDB_PATTERN_STRING_MAX_LEN;
|
||||
|
@ -991,6 +999,16 @@ static void doInitGlobalConfig(void) {
|
|||
cfg.unitType = TAOS_CFG_UTYPE_NONE;
|
||||
taosInitConfigOption(cfg);
|
||||
|
||||
cfg.option = "compressColData";
|
||||
cfg.ptr = &tsCompressColData;
|
||||
cfg.valType = TAOS_CFG_VTYPE_INT8;
|
||||
cfg.cfgType = TSDB_CFG_CTYPE_B_CONFIG | TSDB_CFG_CTYPE_B_SHOW;
|
||||
cfg.minValue = 0;
|
||||
cfg.maxValue = 1;
|
||||
cfg.ptrLength = 0;
|
||||
cfg.unitType = TAOS_CFG_UTYPE_NONE;
|
||||
taosInitConfigOption(cfg);
|
||||
|
||||
cfg.option = "maxSQLLength";
|
||||
cfg.ptr = &tsMaxSQLStringLen;
|
||||
cfg.valType = TAOS_CFG_VTYPE_INT32;
|
||||
|
|
|
@ -357,7 +357,7 @@ int32_t qDumpRetrieveResult(qinfo_t qinfo, SRetrieveTableRsp **pRsp, int32_t *co
|
|||
}
|
||||
|
||||
(*pRsp)->precision = htons(pQueryAttr->precision);
|
||||
(*pRsp)->compressed = (int8_t)checkNeedToCompressQueryCol(pQInfo);
|
||||
(*pRsp)->compressed = (int8_t)(tsCompressColData && checkNeedToCompressQueryCol(pQInfo));
|
||||
|
||||
if (GET_NUM_OF_RESULTS(&(pQInfo->runtimeEnv)) > 0 && pQInfo->code == TSDB_CODE_SUCCESS) {
|
||||
doDumpQueryResult(pQInfo, (*pRsp)->data, (*pRsp)->compressed, &compLen);
|
||||
|
|
Loading…
Reference in New Issue