Repository navigation
Optimize slow event queries and incremental vacuum - #1716
Merged
Merged
Conversation
Contributor
|
🚨 SLOP COP 🚨 · I am SlopCop, and I am reviewing this pull request now. I will check security, code quality, architecture, duplicate code, performance, and tests. |
Contributor
There was a problem hiding this comment.
🚨 SLOP COP 🚨 · review
Plain English summary
This change makes three database jobs faster. It adds a small index for parent checks. It combines two background-task scans. It also removes full-database reads from routine incremental vacuum work.
Review result
I found no blocking or non-blocking defects.
- Security: The SQL uses fixed internal values. The migration keeps transaction and rollback protection.
- Code quality: The new result type matches all callers. The tests cover query plans, migration behavior, and vacuum results.
- Architecture: The changes stay in the database package. I found no duplicate code or useful refactor.
- Performance: Real-data checks showed large read gains. The new index added a small write cost for tool-call rows only.
- Validation: All 387 database tests passed. The database type check passed. Relevant timeline tests passed. All current GitHub CI checks passed.
- Browser test: I did not run one because this change has no user-interface route.
The final independent review gate returned APPROVE. I posted this as a comment-only review.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
dbstatscans from incremental vacuum passesLocal database benchmark
Benchmarked against an isolated online-backup copy of the 1.35 GiB local database:
The live source database was opened read-only and was not migrated or modified.
Validation
pnpm exec turbo run typecheck --filter=@bb/dbpnpm exec turbo run typecheck --filter=@bb/serverpnpm exec turbo run test --filter=@bb/db --force(387 tests)pnpm exec turbo run test --filter=@bb/server --force(1,693 tests)Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.