1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-04-18 21:44:02 +03:00

perf(primproc) MCOL-5601: Initilize two fields once in ctor instead of calling makeConfig

std::string fTmpDir = config::Config::makeConfig()->getTempFileDir(config::Config::TempDirPurpose::Aggregates);
std::string fCompStr = config::Config::makeConfig()->getConfig("RowAggregation", "Compression");
This commit is contained in:
Leonid Fedorov 2023-12-18 14:48:42 +00:00 committed by Leonid Fedorov
parent 9d5ad925eb
commit 4d7a6a0be5
2 changed files with 10 additions and 12 deletions

View File

@ -675,19 +675,16 @@ void RowAggregation::initialize(bool hasGroupConcat)
}
}
config::Config* config = config::Config::makeConfig();
string tmpDir = config->getTempFileDir(config::Config::TempDirPurpose::Aggregates);
string compStr = config->getConfig("RowAggregation", "Compression");
auto* compressor = compress::getCompressInterfaceByName(compStr);
auto* compressor = compress::getCompressInterfaceByName(fCompStr);
if (fKeyOnHeap)
{
fRowAggStorage.reset(new RowAggStorage(tmpDir, fRowGroupOut, &fKeyRG, fAggMapKeyCount, fRm,
fRowAggStorage.reset(new RowAggStorage(fTmpDir, fRowGroupOut, &fKeyRG, fAggMapKeyCount, fRm,
fSessionMemLimit, disk_agg, allow_gen, compressor));
}
else
{
fRowAggStorage.reset(new RowAggStorage(tmpDir, fRowGroupOut, fAggMapKeyCount, fRm, fSessionMemLimit,
fRowAggStorage.reset(new RowAggStorage(fTmpDir, fRowGroupOut, fAggMapKeyCount, fRm, fSessionMemLimit,
disk_agg, allow_gen, compressor));
}
@ -768,19 +765,16 @@ void RowAggregation::aggReset()
}
}
config::Config* config = config::Config::makeConfig();
string tmpDir = config->getTempFileDir(config::Config::TempDirPurpose::Aggregates);
string compStr = config->getConfig("RowAggregation", "Compression");
auto* compressor = compress::getCompressInterfaceByName(compStr);
auto* compressor = compress::getCompressInterfaceByName(fCompStr);
if (fKeyOnHeap)
{
fRowAggStorage.reset(new RowAggStorage(tmpDir, fRowGroupOut, &fKeyRG, fAggMapKeyCount, fRm,
fRowAggStorage.reset(new RowAggStorage(fTmpDir, fRowGroupOut, &fKeyRG, fAggMapKeyCount, fRm,
fSessionMemLimit, disk_agg, allow_gen, compressor));
}
else
{
fRowAggStorage.reset(new RowAggStorage(tmpDir, fRowGroupOut, fAggMapKeyCount, fRm, fSessionMemLimit,
fRowAggStorage.reset(new RowAggStorage(fTmpDir, fRowGroupOut, fAggMapKeyCount, fRm, fSessionMemLimit,
disk_agg, allow_gen, compressor));
}
fRowGroupOut->getRow(0, &fRow);

View File

@ -635,6 +635,10 @@ class RowAggregation : public messageqcpp::Serializeable
boost::shared_ptr<int64_t> fSessionMemLimit;
std::unique_ptr<RGData> fCurRGData;
bool fRollupFlag = false;
std::string fTmpDir = config::Config::makeConfig()->getTempFileDir(config::Config::TempDirPurpose::Aggregates);
std::string fCompStr = config::Config::makeConfig()->getConfig("RowAggregation", "Compression");
};
//------------------------------------------------------------------------------