-
Notifications
You must be signed in to change notification settings - Fork 52
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
Narek/streaming hnsw index selects #322
base: main
Are you sure you want to change the base?
Conversation
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.
PR Summary
- Renamed and reorganized SQL update files for better structure
- Updated triggers and functions for async tasks and vector search
- Modified HNSW index scan logic with
continue_search
variable - Updated
third_party/usearch
submodule to a new commit hash - Added empty
sql/updates/0.3.0--0.3.1.sql
file for version tracking
src/hnsw/scan.c
Outdated
@@ -181,6 +181,7 @@ bool ldb_amgettuple(IndexScanDesc scan, ScanDirection dir) | |||
|
|||
int ef = ldb_hnsw_ef_search; // 0 if not set, but we pass it into usearch_custom_ef anyway since 0 is also a | |||
// sentinel value there | |||
bool continue_search = false; |
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.
Introduced continue_search
to manage search state.
src/hnsw/scan.c
Outdated
@@ -225,6 +226,7 @@ bool ldb_amgettuple(IndexScanDesc scan, ScanDirection dir) | |||
scanstate->usearch_scalar, | |||
k, | |||
ef, | |||
continue_search, |
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.
Passed continue_search
to usearch_search_ef
.
@@ -252,6 +254,8 @@ bool ldb_amgettuple(IndexScanDesc scan, ScanDirection dir) | |||
return false; |
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.
Set continue_search
to true for subsequent searches.
src/hnsw/scan.c
Outdated
@@ -272,12 +276,14 @@ bool ldb_amgettuple(IndexScanDesc scan, ScanDirection dir) | |||
scanstate->usearch_scalar, | |||
k, | |||
ef, | |||
continue_search, |
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.
Passed continue_search
to usearch_search_ef
.
scanstate->labels, | ||
scanstate->distances, | ||
&error); | ||
ldb_wal_retriever_area_reset(scanstate->retriever_ctx); | ||
|
||
scanstate->count = num_returned; | ||
scanstate->current = 0; |
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.
Reset scanstate->current
to 0 after search.
third_party/usearch
Outdated
@@ -1 +1 @@ | |||
Subproject commit a20193e1f3e10e18c0a8edd860727b11bf424e44 | |||
Subproject commit ece8908a58597ffa6570ca6fc5ef043103d05038 |
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.
Updated submodule commit from a20193e1f3e10e18c0a8edd860727b11bf424e44 to ece8908a58597ffa6570ca6fc5ef043103d05038.
7302bbb
to
c29f9aa
Compare
Default to streaming search for index pagination This used to have a GUC option. I removed streaming search GUC and defaulted to it becasue the old approach had an issue and could simetimes skip some index values and never returned them when paginating
53bb3bb
to
194e0f1
Compare
194e0f1
to
87aa88a
Compare
No description provided.