Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions vector/src/function/create_hnsw_index.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,11 @@ static std::unique_ptr<TableFuncBindData> createInMemHNSWBindFunc(main::ClientCo
}
const auto tableID = nodeTableEntry->getTableID();
HNSWIndexUtils::validateColumnType(*nodeTableEntry, columnName);
const auto& table =
auto& table =
storage::StorageManager::Get(*context)->getTable(tableID)->cast<storage::NodeTable>();
auto propertyID = nodeTableEntry->getPropertyID(columnName);
auto transaction = transaction::Transaction::Get(*context);
auto numNodes = table.getStats(transaction).getTableCard();
auto numNodes = table.getNumTotalRows(transaction);
return std::make_unique<CreateHNSWIndexBindData>(context, indexName, nodeTableEntry, propertyID,
numNodes, std::move(config));
}
Expand Down
4 changes: 2 additions & 2 deletions vector/src/index/hnsw_index.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -669,11 +669,11 @@ void OnDiskHNSWIndex::update(Transaction* transaction, const common::ValueVector

void OnDiskHNSWIndex::finalize(main::ClientContext* context) {
auto& hnswStorageInfo = storageInfo->cast<HNSWStorageInfo>();
const auto numTotalRows = nodeTable.getNumTotalRows(&DUMMY_CHECKPOINT_TRANSACTION);
auto transaction = Transaction::Get(*context);
const auto numTotalRows = nodeTable.getNumTotalRows(transaction);
if (numTotalRows == hnswStorageInfo.numCheckpointedNodes) {
return;
}
auto transaction = Transaction::Get(*context);
auto [nodeTableEntry, upperRelTableEntry, lowerRelTableEntry] =
getIndexTableCatalogEntries(catalog::Catalog::Get(*context), transaction, indexInfo);
const auto embeddingDim = typeInfo.constPtrCast<common::ArrayTypeInfo>()->getNumElements();
Expand Down
3 changes: 3 additions & 0 deletions vector/src/index/hnsw_rel_batch_insert.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,9 @@ void HNSWRelBatchInsert::writeToTable(processor::RelBatchInsertExecutionState& e
common::idx_t neighbourIdx = 0;
// write neighbour offset + unique rel ID for each rel
for (const auto neighbourGraphOffset : neighbours) {
if (neighbourGraphOffset == common::INVALID_OFFSET) {
continue;
}
const auto neighbourNodeOffset = selectionMap.graphToNodeOffset(neighbourGraphOffset);
const auto relRowIdx = boundNodeCSROffset + neighbourIdx;
const auto relID = startRelID + numRelsWritten;
Expand Down
Loading