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
Improve batch inserts.
1) Instead of making dbrm calls to writeVBEntry() per block, we make these calls per batch. This can have non-trivial reductions in the overhead of these calls if the batch size is large. 2) In dmlproc, do not deserialize the whole insertpackage, which consists of the complete record set per column, which would be wasteful as we only need some metadata fields from insertpackage here. This is only done for batch inserts at the moment, this should also be applied to single inserts.
This commit is contained in:
@ -66,16 +66,16 @@ int InsertDMLPackage::write(messageqcpp::ByteStream& bytestream)
|
||||
bytestream << (uint8_t)fLogging;
|
||||
bytestream << (uint8_t)fLogending;
|
||||
|
||||
if (fTable != 0)
|
||||
{
|
||||
retval = fTable->write(bytestream);
|
||||
}
|
||||
|
||||
bytestream << fTableOid;
|
||||
bytestream << static_cast<const messageqcpp::ByteStream::byte>(fIsInsertSelect);
|
||||
bytestream << static_cast<const messageqcpp::ByteStream::byte>(fIsBatchInsert);
|
||||
bytestream << static_cast<const messageqcpp::ByteStream::byte>(fIsAutocommitOn);
|
||||
|
||||
if (fTable != 0)
|
||||
{
|
||||
retval = fTable->write(bytestream);
|
||||
}
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
||||
@ -100,15 +100,50 @@ int InsertDMLPackage::read(messageqcpp::ByteStream& bytestream)
|
||||
bytestream >> logending;
|
||||
fLogending = (logending != 0);
|
||||
|
||||
bytestream >> fTableOid;
|
||||
bytestream >> reinterpret_cast<messageqcpp::ByteStream::byte&>(fIsInsertSelect);
|
||||
bytestream >> reinterpret_cast<messageqcpp::ByteStream::byte&>(fIsBatchInsert);
|
||||
bytestream >> reinterpret_cast<messageqcpp::ByteStream::byte&>(fIsAutocommitOn);
|
||||
|
||||
fTable = new DMLTable();
|
||||
retval = fTable->read(bytestream);
|
||||
bytestream >> fTableOid;
|
||||
bytestream >> reinterpret_cast< messageqcpp::ByteStream::byte&>(fIsInsertSelect);
|
||||
bytestream >> reinterpret_cast< messageqcpp::ByteStream::byte&>(fIsBatchInsert);
|
||||
bytestream >> reinterpret_cast< messageqcpp::ByteStream::byte&>(fIsAutocommitOn);
|
||||
return retval;
|
||||
}
|
||||
|
||||
void InsertDMLPackage::readMetaData(messageqcpp::ByteStream& bytestream)
|
||||
{
|
||||
messageqcpp::ByteStream::quadbyte session_id;
|
||||
bytestream >> session_id;
|
||||
fSessionID = session_id;
|
||||
bytestream >> fUuid;
|
||||
|
||||
std::string dmlStatement;
|
||||
bytestream >> fDMLStatement;
|
||||
bytestream >> fSQLStatement;
|
||||
bytestream >> fSchemaName;
|
||||
bytestream >> fTimeZone;
|
||||
uint8_t logging;
|
||||
bytestream >> logging;
|
||||
fLogging = (logging != 0);
|
||||
uint8_t logending;
|
||||
bytestream >> logending;
|
||||
fLogending = (logending != 0);
|
||||
|
||||
bytestream >> fTableOid;
|
||||
bytestream >> reinterpret_cast<messageqcpp::ByteStream::byte&>(fIsInsertSelect);
|
||||
bytestream >> reinterpret_cast<messageqcpp::ByteStream::byte&>(fIsBatchInsert);
|
||||
bytestream >> reinterpret_cast<messageqcpp::ByteStream::byte&>(fIsAutocommitOn);
|
||||
|
||||
fTable = new DMLTable();
|
||||
fTable->readMetaData(bytestream);
|
||||
}
|
||||
|
||||
// Has to be called after InsertDMLPackage::readMetaData()
|
||||
void InsertDMLPackage::readRowData(messageqcpp::ByteStream& bytestream)
|
||||
{
|
||||
fTable->readRowData(bytestream);
|
||||
}
|
||||
|
||||
int InsertDMLPackage::buildFromBuffer(std::string& buffer, int columns, int rows)
|
||||
{
|
||||
#ifdef DML_PACKAGE_DEBUG
|
||||
|
Reference in New Issue
Block a user