v0.8.46: keyword search optimizations - #7976
Merged
Merged
Conversation
waleedlatif1
commented
Sep 18, 2026
Collaborator
- fix(file-search): isolate and queue concurrent searches (fix(file-search): isolate and queue concurrent searches #7952)
- improvement(knowledge): match keyword chunks before authorizing them (improvement(knowledge): match keyword chunks before authorizing them #7973)
* fix(file-search): allow larger concurrent search bursts * fix(file-search): isolate and queue search transactions * fix(file-search): bound admission waits and propagate cancellation
…7973) The org-scoped keyword leg built its candidate set in the order visibility -> match -> rank. The visibility predicate carries a correlated subquery per connector plus a search-integration check, so evaluating it across the base before the query terms were consulted priced every search by how many documents the base holds rather than by how many the query matched. Reorder to match -> authorize -> rank. The match stage carries chunk identifiers only, the identical visibility predicate then runs over just the documents that matched, and ts_rank_cd is computed for the matches that survive it. Same predicate, same ordering, same page contract. Two details keep the reorder from paying the saving back. Restricting the predicate with `document.id = ANY (...)` rather than a subquery keeps the narrowed lookup on a bitmap scan, which prefetches, where a plain `IN (SELECT ...)` plans as an index walk that does not. And ranking in the match stage rather than after authorization would detoast one text-search vector per match, which on a mid-frequency term costs more than the pass it replaces.
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Contributor
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.