Skip to content

perf(memory): bound lexical ranking candidates - #1242

Merged
dcramer merged 1 commit into
mainfrom
codex/bound-memory-lexical-ranking
Aug 4, 2026
Merged

dcramer merged 1 commit into
mainfrom
codex/bound-memory-lexical-ranking

Conversation

@dcramer

@dcramer dcramer commented Aug 4, 2026

Copy link
Copy Markdown
Member

Memory lexical search now limits the GIN-matched candidate set before calculating ts_rank_cd. Previously PostgreSQL ranked every active row matching any query lexeme, so broad automatic-recall queries could keep database backends busy for minutes even though the scope-aware GIN index handled filtering.

The query keeps the existing partial-match behavior, selects a recent candidate window at four times the requested limit, caps that window at 1,000 rows, and ranks only those candidates. This bounds the expensive ranking work while preserving the existing vector/lexical fusion and recall-quality scenarios. The full 76-test memory storage suite and repository pre-push checks pass.

@vercel

vercel Bot commented Aug 4, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
junior-docs Ready Ready Preview Aug 4, 2026 11:37pm

Request Review

@dcramer
dcramer marked this pull request as ready for review August 4, 2026 23:37
@github-actions github-actions Bot added the risk: low PR risk score: low label Aug 4, 2026
@dcramer
dcramer merged commit 539a740 into main Aug 4, 2026
32 checks passed
@dcramer
dcramer deleted the codex/bound-memory-lexical-ranking branch August 4, 2026 23:43

This branch was successfully deployed

1 active deployment
Preview – junior-docs — 7e1ad844 Deployed Aug 4, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk: low PR risk score: low

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant