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
MCOL-641 Refactor initial extent elimination support.
This commit also adds support in TupleHashJoinStep::forwardCPData, although we currently do not support wide decimals as join keys. Row estimation to determine large-side of the join is also updated.
This commit is contained in:
committed by
Roman Nozdrin
parent
ca53b6348a
commit
d3bc68b02f
@ -34,6 +34,9 @@
|
||||
#include "we_log.h"
|
||||
#include "cacheutils.h"
|
||||
#include "IDBPolicy.h"
|
||||
#include "widedecimalutils.h"
|
||||
#include "mcs_decimal.h"
|
||||
#include "dataconvert.h"
|
||||
|
||||
namespace WriteEngine
|
||||
{
|
||||
@ -294,11 +297,11 @@ void BRMReporter::sendHWMToFile( )
|
||||
//------------------------------------------------------------------------------
|
||||
// Send Casual Partition update information to BRM
|
||||
//------------------------------------------------------------------------------
|
||||
// TODO MCOL-641
|
||||
void BRMReporter::sendCPToFile( )
|
||||
{
|
||||
if (fCPInfo.size() > 0)
|
||||
{
|
||||
char buf[utils::MAXLENGTH16BYTES];
|
||||
std::ostringstream oss;
|
||||
oss << "Writing " << fCPInfo.size() << " CP updates for table " <<
|
||||
fTableName << " to report file " << fRptFileName;
|
||||
@ -306,12 +309,32 @@ void BRMReporter::sendCPToFile( )
|
||||
|
||||
for (unsigned int i = 0; i < fCPInfo.size(); i++)
|
||||
{
|
||||
fRptFile << "CP: " << fCPInfo[i].startLbid << ' ' <<
|
||||
fCPInfo[i].max << ' ' <<
|
||||
fCPInfo[i].min << ' ' <<
|
||||
fCPInfo[i].seqNum << ' ' <<
|
||||
fCPInfo[i].type << ' ' <<
|
||||
fCPInfo[i].newExtent << std::endl;
|
||||
if (!datatypes::Decimal::isWideDecimalType(fCPInfo[i].type, fCPInfo[i].colWidth))
|
||||
{
|
||||
fRptFile << "CP: " << fCPInfo[i].startLbid << ' ' <<
|
||||
fCPInfo[i].max << ' ' <<
|
||||
fCPInfo[i].min << ' ' <<
|
||||
fCPInfo[i].seqNum << ' ' <<
|
||||
fCPInfo[i].type << ' ' <<
|
||||
fCPInfo[i].newExtent << std::endl;
|
||||
}
|
||||
else
|
||||
{
|
||||
std::string bigMin, bigMax;
|
||||
|
||||
dataconvert::DataConvert::decimalToString(&fCPInfo[i].bigMin, 0, buf, utils::MAXLENGTH16BYTES, fCPInfo[i].type);
|
||||
bigMin = buf;
|
||||
|
||||
dataconvert::DataConvert::decimalToString(&fCPInfo[i].bigMax, 0, buf, utils::MAXLENGTH16BYTES, fCPInfo[i].type);
|
||||
bigMax = buf;
|
||||
|
||||
fRptFile << "CP: " << fCPInfo[i].startLbid << ' ' <<
|
||||
bigMax << ' ' <<
|
||||
bigMin << ' ' <<
|
||||
fCPInfo[i].seqNum << ' ' <<
|
||||
fCPInfo[i].type << ' ' <<
|
||||
fCPInfo[i].newExtent << std::endl;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -40,6 +40,7 @@
|
||||
#include "dataconvert.h"
|
||||
#include "exceptclasses.h"
|
||||
#include "mcs_decimal.h"
|
||||
#include "widedecimalutils.h"
|
||||
|
||||
#include "joblisttypes.h"
|
||||
|
||||
@ -1735,8 +1736,8 @@ int BulkLoadBuffer::parseCol(ColumnInfo& columnInfo)
|
||||
}
|
||||
else
|
||||
{
|
||||
dataconvert::DataConvert::int128Max(bufStats.bigMinBufferVal);
|
||||
dataconvert::DataConvert::int128Min(bufStats.bigMaxBufferVal);
|
||||
utils::int128Max(bufStats.bigMinBufferVal);
|
||||
utils::int128Min(bufStats.bigMaxBufferVal);
|
||||
}
|
||||
updateCPInfoPendingFlag = false;
|
||||
}
|
||||
|
@ -31,6 +31,7 @@
|
||||
#include "we_columninfo.h"
|
||||
#include "calpontsystemcatalog.h"
|
||||
#include "dataconvert.h"
|
||||
#include "widedecimalutils.h"
|
||||
|
||||
namespace WriteEngine
|
||||
{
|
||||
@ -66,8 +67,8 @@ public:
|
||||
{
|
||||
minBufferVal = MAX_BIGINT;
|
||||
maxBufferVal = MIN_BIGINT;
|
||||
dataconvert::DataConvert::int128Max(bigMinBufferVal);
|
||||
dataconvert::DataConvert::int128Min(bigMaxBufferVal);
|
||||
utils::int128Max(bigMinBufferVal);
|
||||
utils::int128Min(bigMaxBufferVal);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -27,6 +27,7 @@
|
||||
|
||||
#include "we_colextinf.h"
|
||||
#include "dataconvert.h"
|
||||
#include "widedecimalutils.h"
|
||||
|
||||
#include <iostream>
|
||||
#include <sstream>
|
||||
@ -93,7 +94,7 @@ void ColExtInf::addOrUpdateEntryTemplate( RID lastInputRow,
|
||||
// MAX_INT and maxVal will be MIN_INT (see getCPInfoForBRM()).
|
||||
|
||||
__int128 bigMinValInit;
|
||||
dataconvert::DataConvert::int128Max(bigMinValInit);
|
||||
utils::int128Max(bigMinValInit);
|
||||
if ((iter->second.fMinVal == LLONG_MIN && width <= 8) ||
|
||||
(iter->second.fbigMinVal == bigMinValInit && width > 8)) // init the range
|
||||
{
|
||||
|
@ -41,6 +41,7 @@
|
||||
#include "brmtypes.h"
|
||||
#include "we_type.h"
|
||||
#include "dataconvert.h"
|
||||
#include "widedecimalutils.h"
|
||||
|
||||
namespace WriteEngine
|
||||
{
|
||||
@ -65,8 +66,8 @@ public:
|
||||
fMaxVal(LLONG_MIN),
|
||||
fNewExtent(true)
|
||||
{
|
||||
dataconvert::DataConvert::int128Min(fbigMaxVal);
|
||||
dataconvert::DataConvert::int128Max(fbigMinVal);
|
||||
utils::int128Min(fbigMaxVal);
|
||||
utils::int128Max(fbigMinVal);
|
||||
}
|
||||
|
||||
// Used to create entry for an existing extent we are going to add data to.
|
||||
@ -76,8 +77,8 @@ public:
|
||||
fMaxVal(LLONG_MIN),
|
||||
fNewExtent(bIsNewExtent)
|
||||
{
|
||||
dataconvert::DataConvert::int128Min(fbigMaxVal);
|
||||
dataconvert::DataConvert::int128Max(fbigMinVal);
|
||||
utils::int128Min(fbigMaxVal);
|
||||
utils::int128Max(fbigMinVal);
|
||||
}
|
||||
|
||||
// Used to create entry for a new extent, with LBID not yet allocated
|
||||
|
@ -40,6 +40,7 @@ using namespace std;
|
||||
using namespace execplan;
|
||||
|
||||
#include "dataconvert.h"
|
||||
#include "widedecimalutils.h"
|
||||
#include "IDBDataFile.h"
|
||||
#include "IDBPolicy.h"
|
||||
|
||||
@ -1140,8 +1141,8 @@ int ColumnOp::fillColumn(const TxnID& txnid, Column& column, Column& refCol, voi
|
||||
}
|
||||
else
|
||||
{
|
||||
dataconvert::DataConvert::int128Min(cpInfo.bigMax);
|
||||
dataconvert::DataConvert::int128Max(cpInfo.bigMin);
|
||||
utils::int128Min(cpInfo.bigMax);
|
||||
utils::int128Max(cpInfo.bigMin);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1193,8 +1194,8 @@ int ColumnOp::fillColumn(const TxnID& txnid, Column& column, Column& refCol, voi
|
||||
}
|
||||
else
|
||||
{
|
||||
dataconvert::DataConvert::int128Min(cpInfo1.bigMax);
|
||||
dataconvert::DataConvert::int128Max(cpInfo1.bigMin);
|
||||
utils::int128Min(cpInfo1.bigMax);
|
||||
utils::int128Max(cpInfo1.bigMin);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1170,8 +1170,8 @@ int WriteEngineWrapper::insertColumnRecs(const TxnID& txnid,
|
||||
}
|
||||
else
|
||||
{
|
||||
dataconvert::DataConvert::int128Min(cpInfo.bigMax);
|
||||
dataconvert::DataConvert::int128Max(cpInfo.bigMin);
|
||||
utils::int128Min(cpInfo.bigMax);
|
||||
utils::int128Max(cpInfo.bigMin);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1916,8 +1916,8 @@ int WriteEngineWrapper::insertColumnRecsBinary(const TxnID& txnid,
|
||||
}
|
||||
else
|
||||
{
|
||||
dataconvert::DataConvert::int128Min(cpInfo.bigMax);
|
||||
dataconvert::DataConvert::int128Max(cpInfo.bigMin);
|
||||
utils::int128Min(cpInfo.bigMax);
|
||||
utils::int128Max(cpInfo.bigMin);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user