Skip to content

Revert "fix: prefix match last search term for multi-dot queries (#139)" - #156

Merged
mj-palanker merged 1 commit into
mainfrom
mjp/revert-pr-139-fts-prefix
Jul 27, 2026
Merged

Revert "fix: prefix match last search term for multi-dot queries (#139)"#156
mj-palanker merged 1 commit into
mainfrom
mjp/revert-pr-139-fts-prefix

Conversation

@mj-palanker

Copy link
Copy Markdown
Contributor

There are major performance problems with this fix. we need to land a real fix for this edge case that doesn't blow up performance.

This reverts commit cf492ec.

The query-time :* prefix operator added by #139 causes pathological GIN scans: because our fts_data vectors are prefix-dense by design (edge-grams index every prefix of every word), a trailing prefix term like 'prod':* must range-scan and union the posting lists of every lexeme starting with that string. On a large tenant this turned a sub-second search into a 43s query. Prefix expansion belongs at write time in this schema; a follow-up restores multi-dot partial matching via index-side sub-token edge-grams and query-side symbol normalization, without :*.

This reverts commit cf492ec.

The query-time :* prefix operator added by #139 causes pathological GIN
scans: because our fts_data vectors are prefix-dense by design (edge-grams
index every prefix of every word), a trailing prefix term like 'prod':*
must range-scan and union the posting lists of every lexeme starting with
that string. On a large tenant this turned a sub-second search into a 43s
query. Prefix expansion belongs at write time in this schema; a follow-up
restores multi-dot partial matching via index-side sub-token edge-grams
and query-side symbol normalization, without :*.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@mj-palanker
mj-palanker merged commit 791cac7 into main Jul 27, 2026
4 checks passed
@mj-palanker
mj-palanker deleted the mjp/revert-pr-139-fts-prefix branch July 27, 2026 17:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants