1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-07-29 08:21:15 +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:
Gagan Goel
2020-05-10 19:38:06 -04:00
parent 04fdacb927
commit d4d0ebdf5d
13 changed files with 306 additions and 36 deletions

View File

@ -1737,38 +1737,44 @@ int BRMWrapper::writeVB(IDBDataFile* pSourceFile, const VER_t transID, const OID
if (rc != NO_ERROR)
goto cleanup;
for (; processedBlocks < (k + rangeListCount); processedBlocks++)
std::vector<BRM::LBID_t> lbids(k);
std::vector<uint32_t> vbFBOs(k);
size_t idx = 0;
for (; processedBlocks < (k + rangeListCount); processedBlocks++, idx++)
{
rc = blockRsltnMgrPtr->writeVBEntry(transID, rangeList[processedBlocks].start,
freeList[i].vbOID, freeList[i].vbFBO + (processedBlocks - rangeListCount));
lbids[idx] = rangeList[processedBlocks].start;
vbFBOs[idx] = freeList[i].vbFBO + (processedBlocks - rangeListCount);
}
//cout << (uint64_t)rangeList[processedBlocks].start << endl;
if (rc != NO_ERROR)
rc = blockRsltnMgrPtr->bulkWriteVBEntry(transID, lbids, freeList[i].vbOID,
vbFBOs);
if (rc != NO_ERROR)
{
switch (rc)
{
switch (rc)
{
case ERR_DEADLOCK:
rc = ERR_BRM_DEAD_LOCK;
break;
case ERR_DEADLOCK:
rc = ERR_BRM_DEAD_LOCK;
break;
case ERR_VBBM_OVERFLOW:
rc = ERR_BRM_VB_OVERFLOW;
break;
case ERR_VBBM_OVERFLOW:
rc = ERR_BRM_VB_OVERFLOW;
break;
case ERR_NETWORK:
rc = ERR_BRM_NETWORK;
break;
case ERR_NETWORK:
rc = ERR_BRM_NETWORK;
break;
case ERR_READONLY:
rc = ERR_BRM_READONLY;
break;
case ERR_READONLY:
rc = ERR_BRM_READONLY;
break;
default:
rc = ERR_BRM_WR_VB_ENTRY;
}
goto cleanup;
default:
rc = ERR_BRM_WR_VB_ENTRY;
}
goto cleanup;
}
}
}