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

Method delete_

src/processor/operator/persistent/delete_executor.cpp:113–140  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

111}
112
113void SingleLabelNodeDeleteExecutor::delete_(ExecutionContext* context) {
114 DASSERT(tableInfo.pkVector->state == info.nodeIDVector->state);
115 auto deleteState =
116 std::make_unique<NodeTableDeleteState>(*info.nodeIDVector, *tableInfo.pkVector);
117 auto transaction = Transaction::Get(*context->clientContext);
118 if (!tableInfo.table->delete_(transaction, *deleteState)) {
119 return;
120 }
121 switch (info.deleteType) {
122 case DeleteNodeType::DELETE: {
123 tableInfo.deleteFromRelTable(transaction, info.nodeIDVector);
124 } break;
125 case DeleteNodeType::DETACH_DELETE: {
126 const auto& selVector = info.nodeIDVector->state->getSelVector();
127 const auto pos = selVector[0];
128 if (!info.nodeIDVector->isNull(pos)) {
129 appendToBatch(info.nodeIDVector->getValue<internalID_t>(pos));
130 }
131 if (batchNodeIDs.size() >= BATCH_SIZE) {
132 flushBatch(batchNodeIDs, *batchSrcNodeIDVector, tableInfo.fwdRelTables,
133 tableInfo.bwdRelTables, transaction);
134 batchNodeIDs.clear();
135 }
136 } break;
137 default:
138 UNREACHABLE_CODE;
139 }
140}
141
142void MultiLabelNodeDeleteExecutor::init(ResultSet* resultSet, ExecutionContext* context) {
143 NodeDeleteExecutor::init(resultSet, context);

Callers 2

getNextTuplesInternalMethod · 0.45

Calls 7

deleteFromRelTableMethod · 0.80
getSelSizeMethod · 0.80
finalizeFunction · 0.50
isNullMethod · 0.45
sizeMethod · 0.45
clearMethod · 0.45
containsMethod · 0.45

Tested by

no test coverage detected