Skip to content

WIP: SAI skip vector graph refinement on memtable flush #1867

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
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
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,6 @@ private boolean isVectorDataComponent(IndexContext context, IndexComponentType i
@Override
public int jvectorFileFormatVersion()
{
throw new UnsupportedOperationException("JVector is not supported in V2OnDiskFormat");
throw new UnsupportedOperationException("JVector is not supported");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,8 @@ public CassandraOnHeapGraph(IndexContext context, boolean forSearching, Memtable
indexConfig.getConstructionBeamWidth(),
indexConfig.getNeighborhoodOverflow(1.0f), // no overflow means add will be a bit slower but flush will be faster
indexConfig.getAlpha(dimension > 3 ? 1.2f : 2.0f),
indexConfig.isHierarchyEnabled() && jvectorVersion >= 4);
indexConfig.isHierarchyEnabled() && jvectorVersion >= 4,
memtable != null); // Skip graph refinement on memtable to speed up flush
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@marianotepper - should we branch here based on whether it is an in memory build? Or do we want this to be configurable at the index level? memtable is null iff we are building the graph during compaction.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should do some benchmarking before proceeding, but I'm not against the suggested approach.

searchers = ThreadLocal.withInitial(() -> new GraphSearcherAccessManager(new GraphSearcher(builder.getGraph())));
}

Expand Down