Skip to content

Commit 8104b60

Browse files
WIP: SAI skip vector graph refinement on memtable flush
1 parent e2ef6e2 commit 8104b60

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/java/org/apache/cassandra/index/sai/disk/v1/V1OnDiskFormat.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,6 +319,6 @@ private boolean isVectorDataComponent(IndexContext context, IndexComponentType i
319319
@Override
320320
public int jvectorFileFormatVersion()
321321
{
322-
throw new UnsupportedOperationException("JVector is not supported in V2OnDiskFormat");
322+
throw new UnsupportedOperationException("JVector is not supported");
323323
}
324324
}

src/java/org/apache/cassandra/index/sai/disk/vector/CassandraOnHeapGraph.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,8 @@ public CassandraOnHeapGraph(IndexContext context, boolean forSearching, Memtable
169169
indexConfig.getConstructionBeamWidth(),
170170
indexConfig.getNeighborhoodOverflow(1.0f), // no overflow means add will be a bit slower but flush will be faster
171171
indexConfig.getAlpha(dimension > 3 ? 1.2f : 2.0f),
172-
indexConfig.isHierarchyEnabled() && jvectorVersion >= 4);
172+
indexConfig.isHierarchyEnabled() && jvectorVersion >= 4,
173+
memtable != null); // Skip graph refinement on memtable to speed up flush
173174
searchers = ThreadLocal.withInitial(() -> new GraphSearcherAccessManager(new GraphSearcher(builder.getGraph())));
174175
}
175176

0 commit comments

Comments
 (0)