You've already forked mariadb-columnstore-engine
mirror of
https://github.com/mariadb-corporation/mariadb-columnstore-engine.git
synced 2025-07-27 21:01:50 +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:
@ -375,6 +375,10 @@ void SlaveComm::processCommand(ByteStream& msg)
|
||||
do_writeVBEntry(msg);
|
||||
break;
|
||||
|
||||
case BULK_WRITE_VB_ENTRY:
|
||||
do_bulkWriteVBEntry(msg);
|
||||
break;
|
||||
|
||||
case BEGIN_VB_COPY:
|
||||
do_beginVBCopy(msg);
|
||||
break;
|
||||
@ -1758,6 +1762,49 @@ void SlaveComm::do_writeVBEntry(ByteStream& msg)
|
||||
doSaveDelta = true;
|
||||
}
|
||||
|
||||
void SlaveComm::do_bulkWriteVBEntry(ByteStream& msg)
|
||||
{
|
||||
VER_t transID;
|
||||
std::vector<BRM::LBID_t> lbids;
|
||||
OID_t vbOID;
|
||||
std::vector<uint32_t> vbFBOs;
|
||||
uint32_t tmp;
|
||||
int err;
|
||||
ByteStream reply;
|
||||
|
||||
#ifdef BRM_VERBOSE
|
||||
cerr << "WorkerComm: do_bulkWriteVBEntry()" << endl;
|
||||
#endif
|
||||
|
||||
msg >> tmp;
|
||||
transID = tmp;
|
||||
deserializeInlineVector(msg, lbids);
|
||||
msg >> tmp;
|
||||
vbOID = tmp;
|
||||
deserializeInlineVector(msg, vbFBOs);
|
||||
|
||||
if (printOnly)
|
||||
{
|
||||
cout << "bulkWriteVBEntry: transID=" << transID << endl;
|
||||
|
||||
for (size_t i = 0; i < lbids.size(); i++)
|
||||
cout << "bulkWriteVBEntry arg " << i + 1 << ": lbid=" << lbids[i] << " vbOID=" <<
|
||||
vbOID << " vbFBO=" << vbFBOs[i] << endl;
|
||||
return;
|
||||
}
|
||||
|
||||
err = slave->bulkWriteVBEntry(transID, lbids, vbOID, vbFBOs);
|
||||
reply << (uint8_t) err;
|
||||
#ifdef BRM_VERBOSE
|
||||
cerr << "WorkerComm: do_bulkWriteVBEntry() err code is " << err << endl;
|
||||
#endif
|
||||
|
||||
if (!standalone)
|
||||
master.write(reply);
|
||||
|
||||
doSaveDelta = true;
|
||||
}
|
||||
|
||||
void SlaveComm::do_beginVBCopy(ByteStream& msg)
|
||||
{
|
||||
VER_t transID;
|
||||
|
Reference in New Issue
Block a user