Keep #9827. Close #8969 as superseded.
Both work and deliver the same speedup. #9827 fits current main; #8969 needs its migration renumbered.
| Search | Main | #8969 | #9827 |
|---|---|---|---|
| Rare match | 2.88 s | 1.51 s | 1.52 s |
| Common match | 3.11 s | 1.89 s | 1.91 s |
| No match | 2.92 s | 1.53 s | 1.54 s |
Median SQL time over five measured rounds after warmup, with execution order rotated. Same synthetic dataset: 1,000,000 messages, 704,545 turns, 5,000 threads. Node v22.23.2, SQLite 3.51.3. These are local database timings.
- No functional difference found. Both return exactly the same rows as main in all 212 additional query-and-limit cases and every benchmark run. Cases cover literal wildcards, Unicode, hidden threads, streaming messages, duplicate references, ranking, and limits.
- The query, index, and added regression checks are the same. #8969 passes its 28 focused tests; #9827 passes 30 because it includes newer main tests. Both pass server typechecks and additional upgrades with populated tables, duplicate references, and null references.
- #9827 is the cleaner integration. It applies to current main without conflicts and passes 31 focused tests in the combined checkout. #8969 conflicts in the migration registry: 048 is already occupied; #9827 correctly uses 050.
- Both improve this fixture by about 39% to 47%. SQLite uses the new index instead of scanning all turns for assistant-message membership. The index adds 11.83 MiB; searching message text still requires a scan, so this is not instant search.
Continue review on #9827, preserving credit for #8969's original implementation and benchmark work. No PR was closed or merged during this test.
Tested 8 September 2026. Heads 31f157cb and a00e25e7. UI latency and incremental index write cost were not measured.