Skip to content

Drop the obsolete idx_code_code_first_75 index - #2937

Open
manuelwedler wants to merge 2 commits into
stagingfrom
chore/drop-idx-code-code-first-75
Open

Drop the obsolete idx_code_code_first_75 index#2937
manuelwedler wants to merge 2 commits into
stagingfrom
chore/drop-idx-code-code-first-75

Conversation

@manuelwedler

@manuelwedler manuelwedler commented Aug 20, 2026

Copy link
Copy Markdown
Member

Summary

Follow-up to #2918 (see #2891): drops idx_code_code_first_75 on the code table.

Server 4.0.0 finds similarity candidates through the compiled_contracts_runtime_code_prefixes side table. The old prefix index served only the pre-4.0.0 query and was kept as rollback insurance. The new query is now verified on production: worst-case candidate search (prefix shared by ~102k compilations) runs in 75 ms, typical cold lookups in ~156 ms, batch payload fetch in ~94 ms.

The index takes 1.1 GB on production. The drop is instant; the migrate:down recreation scans the whole code table and takes several minutes.

Notes

  • Apply with the next regular release; no backfill or ordering constraints.
  • After this migration, rollback to a pre-4.0.0 server needs the migrate:down first (recreates the index).

The similarity query of server 4.0.0 reads
compiled_contracts_runtime_code_prefixes; the old prefix index on the
code table was kept only as rollback insurance and is verified obsolete
in production. Frees 1.1 GB.
@manuelwedler
manuelwedler force-pushed the chore/drop-idx-code-code-first-75 branch from b2ff7ef to 01d0143 Compare August 20, 2026 09:05
@manuelwedler manuelwedler moved this from Triage to Sprint - Needs Review in Sourcify Public Aug 20, 2026
@kuzdogan

Copy link
Copy Markdown
Member

TODO: Run on staging

@kuzdogan

Copy link
Copy Markdown
Member

TODO 2: Find a naming convention to mark this has a todo for release time.

Potentially if the release script finds the naming convention like [TODO_RELEASE] anywhere, this should pop up during the release script

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Sprint - Needs Review

Development

Successfully merging this pull request may close these issues.

2 participants