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

Rename generic operator. #244

Merged
merged 4 commits into from
Dec 11, 2023
Merged

Rename generic operator. #244

merged 4 commits into from
Dec 11, 2023

Conversation

var77
Copy link
Collaborator

@var77 var77 commented Dec 11, 2023

Rename generic operator <-> to <?> and fix update script for 0.0.9->0.0.10


There was an issue in update script: the tags were being sorted in asc order for ascii codes so the to_tags were like ['0.0.10', '0.0.4', '0.0.5', '0.0.6' ...] while we expect the latest tag to be the last element. So because of it the to_tag to be tested was being selected as 0.0.9 and there was a case when the update script was being run as from_tag=0.0.9 to_tag=0.0.9 and it made database to crash from this assert assert(hdr->blockmap_groups_nr == groupno + 1); in external_index.c:236

@var77 var77 requested a review from Ngalstyan4 December 11, 2023 11:02
Copy link

codecov bot commented Dec 11, 2023

Codecov Report

Merging #244 (8eb6023) into main (896ed5a) will decrease coverage by 0.34%.
The diff coverage is 60.00%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #244      +/-   ##
==========================================
- Coverage   78.06%   77.72%   -0.34%     
==========================================
  Files          23       23              
  Lines        1805     1791      -14     
  Branches      455      455              
==========================================
- Hits         1409     1392      -17     
- Misses        201      206       +5     
+ Partials      195      193       -2     
Files Coverage Δ
src/hnsw/options.c 82.53% <100.00%> (+1.58%) ⬆️
src/hooks/utils.c 81.81% <100.00%> (ø)
src/hnsw.c 79.90% <50.00%> (-0.36%) ⬇️

... and 1 file with indirect coverage changes

Copy link

github-actions bot commented Dec 11, 2023

Benchmarks

metric old new pct change
recall (after create) 0.740 0.740 -
recall (after insert) 0.732 0.778 +6.28%
select bulk tps 481.860 478.706 -0.65%
select bulk latency (ms) 15.515 15.834 +2.06%
select bulk latency (stddev ms) 3.669 4.055 +10.52%
create latency (ms) 1186.241 1205.942 +1.66%
insert bulk tps 10.948 11.169 +2.02%
insert bulk latency (ms) 91.328 89.525 -1.97%
insert bulk latency (stddev ms) 3.173 2.897 -8.70%
disk usage (bytes) 6348800.000 6348800.000 -

@var77 var77 force-pushed the varik/generic-operator-rename branch from ab86c22 to 4db7bd1 Compare December 11, 2023 13:43
Copy link
Contributor

@Ngalstyan4 Ngalstyan4 left a comment

Choose a reason for hiding this comment

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

Looks good!

IF pgvector_exists THEN
am_name := 'lantern_hnsw';
-- these go for good.
DROP OPERATOR CLASS IF EXISTS dist_vec_hamming_ops USING hnsw CASCADE;
Copy link
Contributor

Choose a reason for hiding this comment

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

should this be USING lantern_hnsw?

Copy link
Contributor

Choose a reason for hiding this comment

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

or use am_name? It is the code I had written in the last PR and I think I forgot to consider the changed naming of our AM when pgvector is present

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

True, that should be lantern_hnsw;

(4 rows)
-> Result
-> Sort
Sort Key: (l2sq_dist(vector_int, '{0,1,0}'::integer[]))
Copy link
Contributor

Choose a reason for hiding this comment

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

hm, do you know why before the Sort Key function was schema-qualified (public.l2sq_dist) while now it is not (l2sq_dist) ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Actually that was added after the latest release, before that it was without public if I remember correctly, not sure why but one change that I did to that operator was adding it for integer type as well

@Ngalstyan4 Ngalstyan4 merged commit 0a1227b into main Dec 11, 2023
@Ngalstyan4 Ngalstyan4 deleted the varik/generic-operator-rename branch December 11, 2023 19:22
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.

2 participants