MCPcopy Create free account
hub / github.com/LadybugDB/ladybug / commitInsert

Method commitInsert

src/storage/table/version_info.cpp:596–611  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

594}
595
596void VersionInfo::commitInsert(row_idx_t startRow, row_idx_t numRows, transaction_t commitTS) {
597 if (numRows == 0) {
598 return;
599 }
600 auto [startVectorIdx, startRowIdxInVector] =
601 StorageUtils::getQuotientRemainder(startRow, DEFAULT_VECTOR_CAPACITY);
602 auto [endVectorIdx, endRowIdxInVector] =
603 StorageUtils::getQuotientRemainder(startRow + numRows - 1, DEFAULT_VECTOR_CAPACITY);
604 for (auto vectorIdx = startVectorIdx; vectorIdx <= endVectorIdx; vectorIdx++) {
605 const auto startRowIdx = vectorIdx == startVectorIdx ? startRowIdxInVector : 0;
606 const auto endRowIdx =
607 vectorIdx == endVectorIdx ? endRowIdxInVector : DEFAULT_VECTOR_CAPACITY - 1;
608 auto& vectorVersionInfo = getOrCreateVersionInfo(vectorIdx);
609 vectorVersionInfo.setInsertCommitTS(commitTS, startRowIdx, endRowIdx - startRowIdx + 1);
610 }
611}
612
613void VersionInfo::rollbackInsert(row_idx_t startRow, row_idx_t numRows) {
614 if (numRows == 0) {

Callers 1

processScanOutputMethod · 0.45

Calls 1

setInsertCommitTSMethod · 0.80

Tested by

no test coverage detected