Summary
On a local store with 2,264,574 Passage rows (9,288 revisions, 266 matters), after optimize:
| Query |
Time |
bm25($p.text, $q) over all passages, limit 10 |
0.04 s |
same, scoped to one matter via $p passageOfRevision $r $r: SourceRevision { matter_number: $m } (ranked variable first) |
0.65 s |
bm25 over 125,931 Chunk rows, limit 10 |
0.02 s |
This matches the documented behavior (the traversal leaves the bounded top-k window unfilled, so the engine rescans without the bound), so it is not a defect. Two suggestions: (1) a sentence in docs/user/search/index.md telling catalog authors to scope on the ranked type's own indexed property where possible, or to rank a coarser type first; (2) if cheap, let the bounded scan use a selective traversal prefilter for bm25 the way rrf does, so scoped ranking does not degrade to a full-type rescan.
Version / environment
omnigraph 0.11.0, macOS arm64, file:// store, Homebrew binary.
Related: #750 (ranking on a traversal-introduced target; the query above declares the ranked variable first, so it is the supported shape), #563 (ranked read plus join materialization, closed).
Summary
On a local store with 2,264,574
Passagerows (9,288 revisions, 266 matters), afteroptimize:bm25($p.text, $q)over all passages, limit 10$p passageOfRevision $r $r: SourceRevision { matter_number: $m }(ranked variable first)bm25over 125,931Chunkrows, limit 10This matches the documented behavior (the traversal leaves the bounded top-k window unfilled, so the engine rescans without the bound), so it is not a defect. Two suggestions: (1) a sentence in docs/user/search/index.md telling catalog authors to scope on the ranked type's own indexed property where possible, or to rank a coarser type first; (2) if cheap, let the bounded scan use a selective traversal prefilter for
bm25the wayrrfdoes, so scoped ranking does not degrade to a full-type rescan.Version / environment
omnigraph 0.11.0, macOS arm64,
file://store, Homebrew binary.Related: #750 (ranking on a traversal-introduced target; the query above declares the ranked variable first, so it is the supported shape), #563 (ranked read plus join materialization, closed).