You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(knowledge): walk a large bounded set on the row before ranking it exactly (#8106)
* fix(knowledge): walk a large bounded set on the row before ranking it exactly
A member reading most of a large source, with that source selected as a filter, enumerated a
bounded permitted set of tens of thousands of documents and then ranked every chunk of it
exactly on both legs: the vector leg read every chunk's projected vector, and the keyword leg
materialized every chunk of the set before it matched the term. Cold, each leg outran its budget
and the search returned nothing.
A bounded set past a size limit is now walked on the row first, where the plan's source and ACL
decide readability and the walk stops at its tuple cap, and ranked exactly only when the walk
cannot fill its pool, so recall is never below the exact ranking's. The keyword leg treats the
same set as a narrow on-row reader: Tin windows where Tin serves, otherwise the GIN shape whose
cost follows the term's matches. Sets under the limit keep their exact paths.
* fix(knowledge): refill a large bounded set's pool with the exact ranking once hydration runs it short
The walk decides readability on the projection row, which is broader than the document predicate hydration applies, so a pool the walk filled can still run short of readable rows. The refill for a large bounded set is now the exact ranking, complete over the set, placed behind the rows already read so the pages keep their offsets.
* fix(knowledge): rank a large bounded set's refill past the rows already read
The refill's exact ranking excludes the chunks the pool already holds inside the statement, so every refill is a full window of fresh rows rather than a window thinned by the rows the walk found first.
* fix(knowledge): hand a large bounded set's exhausted Tin windows to the GIN ranking
A narrow reader's page is left short by design once the widest window cannot fill it; a large bounded set's read was exhaustive before, so its widest window that still falls short now hands the page to the GIN ranking, which covers every match.
* fix(knowledge): hand only a large bounded set's first page to the GIN ranking
Tin and GIN order candidates differently, so an offset advanced through one ranking cannot resume the other. A large bounded set's first page that Tin's widest window cannot fill goes to GIN; a later page stays with Tin and is left short as a narrow reader's is.
0 commit comments