perf(server): stop maintaining redundant projection indexes - #12847
Conversation
ApprovabilityVerdict: Approved at Macroscope's review found this PR approvable — This adds a one-time migration that removes four redundant SQLite indexes while retaining composite indexes with the same lookup prefixes. The change is narrowly scoped, preserves query semantics, and includes coverage for normal and preview upgrade paths. You can add or adjust custom eligibility rules. Learn more. |
|
Understand this PR’s impact Explore downstream dependencies and potential security impact with Blast Radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository: pingdotgg/t3code/.coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (3)
Included review availability: Your plan provides up to 10 included reviews per hour; 8 remain after this review. 📝 WalkthroughWalkthroughMigration 054 removes four redundant projection indexes. The migration registry includes it for execution and manifest generation. An in-memory SQLite test verifies that the redundant indexes are absent and covering indexes remain. ChangesProjection Index Cleanup
Priority: ⬇️ Low Estimated code review effort: 2 (Simple) | ~10 minutes Change: Refactor 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
juliusmarminge
left a comment
There was a problem hiding this comment.
Retarget against v2 pls. Would prefer not introducing more migrations on main cause numbers conflicts
695a963 to
5aa2c9a
Compare
Dismissing prior approval to re-evaluate 5aa2c9a
|
Macroscope has since reviewed this pull request. An earlier review was skipped by a cost limit; a review has now completed, so that notice no longer applies. |
5aa2c9a to
9834cc9
Compare
9834cc9 to
5737d93
Compare
Dismissing prior approval to re-evaluate 5737d93
32490b9
into
pingdotgg:t3code/codex-turn-mapping
Four projection indexes are strict prefixes of later ordering indexes. SQLite can use the longer indexes for the same lookups, but every projection write still maintained both B-trees.
Drop the redundant indexes in migration 55, after Orchestrator v2 migration 54, and keep the covering indexes that serve the existing read plans. The migration is safe to rerun and a focused test verifies both sides of that contract.
The benchmark used a 1.25 GB snapshot of a real T3 database and representative activity rows with approximately 3.9 KB payloads.
The representative read kept the same covering-index query plan after the migration.
Validation: the focused migration test runs through Orchestrator v2 migration 54 and the cleanup migration 55. The v2 server typecheck passes, and targeted lint and formatting pass. The copied-database benchmark exercised the same index drops before retargeting.
Model: GPT-5.6 Sol. Harness: Codex in T3 Code.