Skip to content

Avoid redundant work in AbstractKnnVectorQuery.rewrite's optimistic path#16324

Merged
msokolov merged 2 commits into
apache:mainfrom
msokolov:optimistic-vector-query-ignore-empty-tasks
Jul 1, 2026
Merged

Avoid redundant work in AbstractKnnVectorQuery.rewrite's optimistic path#16324
msokolov merged 2 commits into
apache:mainfrom
msokolov:optimistic-vector-query-ignore-empty-tasks

Conversation

@msokolov

@msokolov msokolov commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Found this dumb optimization opportunity while debugging something else. In the normal case, our optimism is borne out and we don't need to revisit any segments for additional HNSW explorations. But we go ahead and run the empty list of tasks anyway. That would be dumb but relatively harmless, but then we also re-merge all the segment results into a global TopK (mergeLeafResults gets called twice) -- which we have already had to do in order to determine the min competitive score.

@github-actions github-actions Bot added this to the 11.0.0 milestone Jul 1, 2026
@msokolov msokolov merged commit 0688940 into apache:main Jul 1, 2026
13 checks passed
@msokolov msokolov deleted the optimistic-vector-query-ignore-empty-tasks branch July 1, 2026 19:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants