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

MCOL-641 Basic extent elimination support for Decimal38.

This commit is contained in:
Gagan Goel
2020-02-01 22:16:58 -05:00
committed by Roman Nozdrin
parent 84f9821720
commit 55afcd8890
33 changed files with 1318 additions and 325 deletions

View File

@ -838,8 +838,7 @@ void TupleBPS::storeCasualPartitionInfo(const bool estimateRowCounts)
scanFlags[idx] = scanFlags[idx] &&
(ignoreCP || extent.partition.cprange.isValid != BRM::CP_VALID ||
lbidListVec[i]->CasualPartitionPredicate(
extent.partition.cprange.lo_val,
extent.partition.cprange.hi_val,
extent.partition.cprange,
&(colCmd->getFilterString()),
colCmd->getFilterCount(),
colCmd->getColType(),
@ -928,7 +927,8 @@ void TupleBPS::prepCasualPartitioning()
{
uint32_t i;
int64_t min, max, seq;
boost::mutex::scoped_lock lk(cpMutex);
__int128 bigMin, bigMax;
boost::mutex::scoped_lock lk(cpMutex);
for (i = 0; i < scannedExtents.size(); i++)
{
@ -938,8 +938,18 @@ void TupleBPS::prepCasualPartitioning()
if (scanFlags[i] && lbidList->CasualPartitionDataType(fColType.colDataType,
fColType.colWidth))
lbidList->GetMinMax(min, max, seq, (int64_t) scannedExtents[i].range.start,
&scannedExtents, fColType.colDataType);
{
if (fColType.colWidth <= 8)
{
lbidList->GetMinMax(min, max, seq, (int64_t) scannedExtents[i].range.start,
&scannedExtents, fColType.colDataType);
}
else if (fColType.colWidth == 16)
{
lbidList->GetMinMax(bigMin, bigMax, seq, (int64_t) scannedExtents[i].range.start,
&scannedExtents, fColType.colDataType);
}
}
}
else
scanFlags[i] = true;
@ -1859,8 +1869,17 @@ abort:
struct _CPInfo
{
_CPInfo(int64_t MIN, int64_t MAX, uint64_t l, bool val) : min(MIN), max(MAX), LBID(l), valid(val) { };
int64_t min;
int64_t max;
_CPInfo(__int128 BIGMIN, __int128 BIGMAX, uint64_t l, bool val) : bigMin(BIGMIN), bigMax(BIGMAX), LBID(l), valid(val) { };
union
{
__int128 bigMin;
int64_t min;
};
union
{
__int128 bigMax;
int64_t max;
};
uint64_t LBID;
bool valid;
};
@ -1878,8 +1897,9 @@ void TupleBPS::receiveMultiPrimitiveMessages(uint32_t threadID)
vector<RGData> fromPrimProc;
bool validCPData;
int64_t min;
int64_t max;
bool hasBinaryColumn;
__int128 min;
__int128 max;
uint64_t lbid;
vector<_CPInfo> cpv;
uint32_t cachedIO;
@ -2154,7 +2174,7 @@ void TupleBPS::receiveMultiPrimitiveMessages(uint32_t threadID)
fromPrimProc.clear();
fBPP->getRowGroupData(*bs, &fromPrimProc, &validCPData, &lbid, &min, &max,
&cachedIO, &physIO, &touchedBlocks, &unused, threadID);
&cachedIO, &physIO, &touchedBlocks, &unused, threadID, &hasBinaryColumn, fColType);
/* Another layer of messiness. Need to refactor this fcn. */
while (!fromPrimProc.empty() && !cancelled())
@ -2318,7 +2338,16 @@ void TupleBPS::receiveMultiPrimitiveMessages(uint32_t threadID)
touchedBlocks_Thread += touchedBlocks;
if (fOid >= 3000 && ffirstStepType == SCAN && bop == BOP_AND)
cpv.push_back(_CPInfo(min, max, lbid, validCPData));
{
if (fColType.colWidth <= 8)
{
cpv.push_back(_CPInfo((int64_t) min, (int64_t) max, lbid, validCPData));
}
else if (fColType.colWidth == 16)
{
cpv.push_back(_CPInfo(min, max, lbid, validCPData));
}
}
} // end of the per-rowgroup processing loop
// insert the resulting rowgroup data from a single bytestream into dlp
@ -2344,8 +2373,16 @@ void TupleBPS::receiveMultiPrimitiveMessages(uint32_t threadID)
for (i = 0; i < size; i++)
{
lbidList->UpdateMinMax(cpv[i].min, cpv[i].max, cpv[i].LBID, fColType.colDataType,
cpv[i].valid);
if (fColType.colWidth > 8)
{
lbidList->UpdateMinMax(cpv[i].bigMin, cpv[i].bigMax, cpv[i].LBID, fColType.colDataType,
cpv[i].valid);
}
else
{
lbidList->UpdateMinMax(cpv[i].min, cpv[i].max, cpv[i].LBID, fColType.colDataType,
cpv[i].valid);
}
}
cpMutex.unlock();
@ -2619,7 +2656,7 @@ out:
if (ffirstStepType == SCAN && bop == BOP_AND && !cancelled())
{
cpMutex.lock();
lbidList->UpdateAllPartitionInfo();
lbidList->UpdateAllPartitionInfo(fColType);
cpMutex.unlock();
}
}