-
Notifications
You must be signed in to change notification settings - Fork 115
[Distance metrics M1] support for L2 distance #156
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
Conversation
cevian
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall looks good but some comments
cevian
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Everything looks good except for the update script which I still have concerns about.
pgrx sets CARGO_TARGET_DIR so we were previously sharing a target dir between multiple versions, which caused havoc. Now set explicitly.
Co-authored-by: Matvey Arye <cevian@gmail.com> Signed-off-by: tjgreen42 <tj@timescale.com>
Co-authored-by: Matvey Arye <cevian@gmail.com> Signed-off-by: tjgreen42 <tj@timescale.com>
Signed-off-by: tjgreen42 <tj@timescale.com>
The cargo environment variable is needed for correct sql generation with versioned so's. Small fixes to migration scripts. Related to work adding l2.
cevian
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
may make sense to squash some commits
Description
This PR adds support for distance metrics besides
cosine, beginning withL2. The primitives for this metric were already present (earlier versions ofpgvectorscaleusedL2rather than cosine), so this PR just adds the operator class-related plumbing. As discussed in the design doc (see references) we followpgvectorsyntax.Testing
DistanceTypeparameter and addedL2versions of some of the callers. We could carry this out systemically and insist that all tests have variants covering all metrics, but this seems like overkill.EXPLAIN PLANthat the correct index is still chosen.test_upgradesucceeds (with generated sql schema, not included in this PR)References