Skip to content

perf(memory): optimize lexical search - #1233

Merged
dcramer merged 1 commit into
mainfrom
codex/optimize-memory-search
Aug 4, 2026
Merged

dcramer merged 1 commit into
mainfrom
codex/optimize-memory-search

Conversation

@dcramer

@dcramer dcramer commented Aug 4, 2026

Copy link
Copy Markdown
Member

Memory lexical search now ranks a stored generated tsvector and uses a GIN index keyed by memory scope and scope key. This avoids rebuilding the content vector for every matching row and keeps common search terms from reading matches in unrelated scopes.

The migration enables btree_gin, adds the generated search column, and rebuilds the search index. It rewrites the memory table once, so larger installations should apply it during lower traffic. In a local 200,000-row benchmark, the representative query improved from 25.6ms to 9.1ms.

@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 9:43pm

Request Review

@dcramer
dcramer marked this pull request as ready for review August 4, 2026 21:45
@github-actions github-actions Bot added the risk: medium PR risk score: medium label Aug 4, 2026
@dcramer
dcramer merged commit 2c8f41a into main Aug 4, 2026
32 checks passed
@dcramer
dcramer deleted the codex/optimize-memory-search branch August 4, 2026 21:47

This branch was successfully deployed

1 active deployment
Preview – junior-docs — 55234e1d 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: medium PR risk score: medium

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant