1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-08-01 06:46:55 +03:00

fix(): periodically return from UM JOIN loop that can produce a lot of RGData-s and thus overcommit for RAM

This commit is contained in:
drrtuy
2025-03-25 17:50:35 +00:00
parent 04b44a835e
commit d1de121476
2 changed files with 6 additions and 1 deletions

View File

@ -1828,7 +1828,10 @@ void TupleHashJoinStep::generateJoinResultSet(const vector<vector<Row::Pointer>
}
else
{
// NB In case of OUTER JOIN this loop can produce a lot of RGDatas,
// so it is a must to periodically flush from this loop.
l_outputRG.getRow(l_outputRG.getRowCount(), &joinedRow);
auto flushThreshold = outputDL->maxElements();
for (i = 0; i < joinerOutput[depth].size(); i++, joinedRow.nextRow(), l_outputRG.incRowCount())
{
@ -1840,7 +1843,7 @@ void TupleHashJoinStep::generateJoinResultSet(const vector<vector<Row::Pointer>
uint64_t baseRid = l_outputRG.getBaseRid();
outputData.push_back(rgData);
// Count the memory
if (UNLIKELY(!getMemory(l_outputRG.getSizeWithStrings())))
if (UNLIKELY(outputData.size() > flushThreshold || !getMemory(l_outputRG.getSizeWithStrings())))
{
// MCOL-5512
if (fe2)

View File

@ -529,6 +529,8 @@ class TupleHashJoinStep : public JobStep, public TupleDeliveryStep
}
void operator()()
{
std::string name = "HJSJoinRun" + std::to_string(index);
utils::setThreadName(name.c_str());
HJ->joinRunnerFcn(index);
}
TupleHashJoinStep* HJ;