You've already forked mariadb-columnstore-engine
mirror of
https://github.com/mariadb-corporation/mariadb-columnstore-engine.git
synced 2025-07-30 19:23:07 +03:00
Add PrimProc support for selective block loading for 16-byte columns.
This commit is contained in:
@ -351,8 +351,8 @@ void BatchPrimitiveProcessorJL::addElementType(const ElementType& et, uint32_t d
|
||||
absRids[ridCount] = et.first;
|
||||
else
|
||||
{
|
||||
relRids[ridCount] = et.first & 0x1fff; // 8192 rows per logical block
|
||||
ridMap |= 1 << (relRids[ridCount] >> 10); // LSB -> 0-1023, MSB -> 7168-8191
|
||||
relRids[ridCount] = et.first & 0x1fff; // 8192 rows per logical block
|
||||
ridMap |= 1 << (relRids[ridCount] >> 9); // LSB -> 0-511, MSB -> 7680-8191
|
||||
}
|
||||
|
||||
if (sendValues)
|
||||
|
@ -297,7 +297,7 @@ private:
|
||||
uint16_t filterCount;
|
||||
uint16_t projectCount;
|
||||
bool needRidsAtDelivery;
|
||||
uint8_t ridMap;
|
||||
uint16_t ridMap;
|
||||
|
||||
// TableBand templateTB;
|
||||
uint32_t tableOID;
|
||||
|
@ -314,7 +314,7 @@ struct ColByScanRequestHeader
|
||||
ColRequestHeaderDataType colType;
|
||||
uint8_t OutputType; // 1 = RID, 2 = Token, 3 = Both
|
||||
uint8_t BOP; // 0 = N/A, 1 = AND, 2 = OR
|
||||
uint8_t RidFlags; // a bitmap indicating the rid ranges in the resultM SB => row 7168-8191
|
||||
uint16_t RidFlags; // a bitmap indicating the rid ranges in the result MSB => row 7680-8191
|
||||
uint16_t NOPS;
|
||||
uint16_t NVALS;
|
||||
uint8_t sort;
|
||||
@ -336,7 +336,7 @@ struct ColByScanRangeRequestHeader
|
||||
ColRequestHeaderDataType colType;
|
||||
uint8_t OutputType; // 1 = RID, 2 = Token, 3 = Both
|
||||
uint8_t BOP; // 0 = N/A, 1 = AND, 2 = OR
|
||||
uint8_t RidFlags; // a bitmap indicating the rid ranges in the result MSB => row 7168-8191
|
||||
uint16_t RidFlags; // a bitmap indicating the rid ranges in the result MSB => row 7680-8191
|
||||
uint16_t NOPS;
|
||||
uint16_t NVALS;
|
||||
uint8_t sort;
|
||||
@ -409,7 +409,7 @@ struct ColResultHeader
|
||||
{
|
||||
PrimitiveHeader Hdr;
|
||||
uint64_t LBID;
|
||||
uint8_t RidFlags;
|
||||
uint16_t RidFlags;
|
||||
uint16_t NVALS;
|
||||
uint16_t ValidMinMax; // 1 if Min/Max are valid, otherwise 0
|
||||
uint32_t OutputType;
|
||||
@ -695,7 +695,7 @@ struct NewColRequestHeader
|
||||
uint8_t OutputType; // OT_DATAVALUE, OT_RID, or OT_BOTH
|
||||
uint8_t BOP;
|
||||
// uint8_t InputFlags; // 1 = interpret each NOP & RID as a pair (deprecated)
|
||||
uint8_t RidFlags; // a bitmap indicating the rid ranges in the result MSB => row 7168-8191
|
||||
uint16_t RidFlags; // a bitmap indicating the rid ranges in the result MSB => row 7680-8191
|
||||
uint16_t NOPS;
|
||||
uint16_t NVALS;
|
||||
uint8_t sort; //1 to sort
|
||||
@ -730,7 +730,7 @@ struct NewColResultHeader
|
||||
ISMPacketHeader ism;
|
||||
PrimitiveHeader hdr;
|
||||
uint64_t LBID;
|
||||
uint8_t RidFlags;
|
||||
uint16_t RidFlags;
|
||||
uint16_t NVALS;
|
||||
uint16_t ValidMinMax; // 1 if Min/Max are valid, otherwise 0
|
||||
uint32_t OutputType;
|
||||
|
@ -774,7 +774,7 @@ inline void store(const NewColRequestHeader* in,
|
||||
}
|
||||
|
||||
#endif
|
||||
out->RidFlags |= (1 << (rid >> 10)); // set the (row/1024)'th bit
|
||||
out->RidFlags |= (1 << (rid >> 9)); // set the (row/512)'th bit
|
||||
memcpy(&out8[*written], &rid, 2);
|
||||
*written += 2;
|
||||
}
|
||||
|
@ -525,7 +525,7 @@ void BatchPrimitiveProcessor::resetBPP(ByteStream& bs, const SP_UM_MUTEX& w,
|
||||
for (uint32_t i = 0; i < ridCount; i++)
|
||||
{
|
||||
relRids[i] = absRids[i] - baseRid;
|
||||
ridMap |= 1 << (relRids[i] >> 10);
|
||||
ridMap |= 1 << (relRids[i] >> 9);
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -1481,7 +1481,7 @@ void BatchPrimitiveProcessor::execute()
|
||||
if (accumulator[i])
|
||||
{
|
||||
relRids[ridCount] = i;
|
||||
ridMap |= 1 << (relRids[ridCount] >> 10);
|
||||
ridMap |= 1 << (relRids[ridCount] >> 9);
|
||||
++ridCount;
|
||||
}
|
||||
}
|
||||
|
@ -224,7 +224,7 @@ private:
|
||||
uint16_t filterCount;
|
||||
uint16_t projectCount;
|
||||
bool sendRidsAtDelivery;
|
||||
uint8_t ridMap;
|
||||
uint16_t ridMap;
|
||||
bool gotAbsRids;
|
||||
bool gotValues;
|
||||
|
||||
|
@ -127,7 +127,7 @@ void ColumnCommand::makeScanMsg()
|
||||
primMsg->ism.Size = baseMsgLength;
|
||||
primMsg->NVALS = 0;
|
||||
primMsg->LBID = lbid;
|
||||
primMsg->RidFlags = 0xFF;
|
||||
primMsg->RidFlags = 0xFFFF;
|
||||
|
||||
// cout << "scanning lbid " << lbid << " colwidth = " << primMsg->DataSize <<
|
||||
// " filterCount = " << filterCount << " outputType = " <<
|
||||
@ -148,7 +148,7 @@ void ColumnCommand::loadData()
|
||||
{
|
||||
uint32_t wasCached;
|
||||
uint32_t blocksRead;
|
||||
uint8_t _mask;
|
||||
uint16_t _mask;
|
||||
uint64_t oidLastLbid = 0;
|
||||
bool lastBlockReached = false;
|
||||
oidLastLbid = getLastLbid();
|
||||
@ -161,7 +161,7 @@ void ColumnCommand::loadData()
|
||||
|
||||
|
||||
_mask = mask;
|
||||
// primMsg->RidFlags = 0xff; // disables selective block loading
|
||||
// primMsg->RidFlags = 0xffff; // disables selective block loading
|
||||
//cout <<__FILE__ << "::issuePrimitive() o: " << getOID() << " l:" << primMsg->LBID << " ll: " << oidLastLbid << endl;
|
||||
|
||||
for (i = 0; i < colType.colWidth; ++i, _mask <<= shift)
|
||||
@ -599,30 +599,28 @@ void ColumnCommand::prep(int8_t outputType, bool absRids)
|
||||
// memcpy(primMsg + 1, filterString.buf(), filterString.length());
|
||||
|
||||
|
||||
|
||||
// JFYI This switch results are used by index scan code that is unused
|
||||
// as of 1.5
|
||||
switch (colType.colWidth)
|
||||
{
|
||||
case 1:
|
||||
shift = 16;
|
||||
mask = 0xFFFF;
|
||||
break;
|
||||
|
||||
case 2:
|
||||
shift = 8;
|
||||
mask = 0xFF;
|
||||
break;
|
||||
|
||||
case 2:
|
||||
case 4:
|
||||
shift = 4;
|
||||
mask = 0x0F;
|
||||
break;
|
||||
|
||||
case 4:
|
||||
case 8:
|
||||
shift = 2;
|
||||
mask = 0x03;
|
||||
break;
|
||||
|
||||
case 8:
|
||||
shift = 1;
|
||||
mask = 0x01;
|
||||
break;
|
||||
case 16:
|
||||
shift = 1;
|
||||
mask = 0x01;
|
||||
|
@ -149,7 +149,7 @@ private:
|
||||
int64_t* values; // this is usually bpp->values; RTSCommand needs to use a different container
|
||||
int128_t* wide128Values;
|
||||
|
||||
uint8_t mask, shift; // vars for the selective block loader
|
||||
uint16_t mask, shift; // vars for the selective block loader
|
||||
|
||||
// counters to decide whether to prefetch or not
|
||||
uint32_t blockCount, loadCount;
|
||||
|
@ -285,7 +285,7 @@ void FilterCommand::doFilter()
|
||||
bpp->wide128Values[bpp->ridCount] = bpp->fFiltCmdBinaryValues[0][i];
|
||||
else
|
||||
bpp->values[bpp->ridCount] = bpp->fFiltCmdValues[0][i];
|
||||
bpp->ridMap |= 1 << (bpp->relRids[bpp->ridCount] >> 10);
|
||||
bpp->ridMap |= 1 << (bpp->relRids[bpp->ridCount] >> 9);
|
||||
bpp->ridCount++;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user