1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-08-05 16:15:50 +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 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); l_outputRG.getRow(l_outputRG.getRowCount(), &joinedRow);
auto flushThreshold = outputDL->maxElements();
for (i = 0; i < joinerOutput[depth].size(); i++, joinedRow.nextRow(), l_outputRG.incRowCount()) 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(); uint64_t baseRid = l_outputRG.getBaseRid();
outputData.push_back(rgData); outputData.push_back(rgData);
// Count the memory // Count the memory
if (UNLIKELY(!getMemory(l_outputRG.getSizeWithStrings()))) if (UNLIKELY(outputData.size() > flushThreshold || !getMemory(l_outputRG.getSizeWithStrings())))
{ {
// MCOL-5512 // MCOL-5512
if (fe2) if (fe2)

View File

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