Skip to content
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

Avoid copy by using VectorView and update benchmark.py for sqlite-vec #21

Merged
merged 5 commits into from
Aug 10, 2024

Conversation

1yefuwang1
Copy link
Owner

@1yefuwang1 1yefuwang1 commented Aug 10, 2024

This PR does 3 things:

  1. Introduce VectorView to avoid unnecessary copy of vectors
  2. Register vector_distance, vector_to_json, vector_from_json as SQLITE_INNOCUOUS and SQLITE_DETERMINISTIC see https://sqlite.org/forum/forumpost/4a8b1f9d3b . So that brute force with vectorlite can be simply done by select rowid from my_table order by vector_distance(some_vector, embedding, 'l2') asc limit 10
  3. Update benchmark.py for sqlite-vec

The benchmark data will be updated when I get access to my PC.

@1yefuwang1 1yefuwang1 merged commit b3c2b6d into main Aug 10, 2024
6 checks passed
@1yefuwang1 1yefuwang1 deleted the bench-sqlite-vec branch August 10, 2024 06:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant