[247] Implement MinHashLSHDeletionSession to speed up key deletions#272
Merged
ekzhu merged 6 commits intoekzhu:masterfrom Nov 8, 2025
Merged
[247] Implement MinHashLSHDeletionSession to speed up key deletions#272ekzhu merged 6 commits intoekzhu:masterfrom
MinHashLSHDeletionSession to speed up key deletions#272ekzhu merged 6 commits intoekzhu:masterfrom
Conversation
ekzhu
reviewed
Nov 6, 2025
ekzhu
approved these changes
Nov 8, 2025
Owner
ekzhu
left a comment
There was a problem hiding this comment.
Let's create a separate PR for adding test_redis.py with integration tests.
This was referenced Nov 8, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
(Resolves #247)
Implementation
We add a
MinHashLSHDeletionSession, similar toMinHashLSHInsertionSessionto support the batched removal of keys. In order to do so, we implement buffered operations for the Redis storage.Note that buffered operations already seem to be implemented for the Cassandra storage layer, so no changes were required to bring about compatibility.
Testing
We add unit tests to ensure the
MinHashLSHDeletionSessionperforms as expected.Benchmarking
On comparing buffered and "non-buffered" key removal across a range of key counts, we find a consistent speedup using buffered operations.
The database resided in
us-east-1while the testing client was in South Asia.The speedup incurred scales with number of keys since we're effectively bringing networks calls (the key bottleneck) down from$O(keys)$ to $O(\lceil\frac{keys}{buffer_size}\rceil)$ .
The benchmarking script can be found here.