[344] Configure SQLite index structures for sqlite_vacuum_cleaner - #377
Merged
2 commits merged intoAug 30, 2026
Conversation
added 2 commits
August 28, 2026 20:39
- Import jest from @jest/globals in failover-recovery tests that used the global (ReferenceError: jest is not defined) - Drop fake-timer usage that captured the mocked setTimeout and hung - Type logger.warn/debug spy calls to satisfy strict tsc - Export SCHEMA_MANAGER_INDEXES from db.ts and import it in the schema manager test (ReferenceError) - Make the Goldii-locks#186 migration-count assertion robust to future migrations - Accept opts argument in the indexer-runner-historical-sync getEvents mock
…i-locks#344) Optimize the events table index schema used by sqlite_vacuum_cleaner so its row lookups resolve through indexes instead of full scans: - Add migration 6 creating the vacuum cleaner lookup indexes (idx_events_created_at, idx_events_ledger_sequence, and the composite idx_events_created_at_ledger / idx_events_ledger_created_at). - Export VACUUM_CLEANER_INDEXES + getVacuumIndexNames() so tests and operators can reference the managed index names. - Add ensureVacuumIndexes() for self-healing databases that predate migration 6. - Add vacuumExplainQueryPlan() / vacuumQueryPlanUsesIndex() helpers mirroring ledger_range_tracker. Tests run EXPLAIN QUERY PLAN against the cleaner's retention-time and ledger-range predicates and assert the managed indexes are utilized for the lookups. Also make the indexer migration-count assertion robust to future migrations.
|
@ToryMic Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
9e42e6f
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
Optimizes the SQLite table index schemas accessed by
sqlite_vacuum_cleanerto improve lookup speeds.idx_events_created_at,idx_events_ledger_sequence, and the compositeidx_events_created_at_ledger/idx_events_ledger_created_at.VACUUM_CLEANER_INDEXES/getVacuumIndexNames()and addsensureVacuumIndexes()so databases predating migration 6 can self-heal.vacuumExplainQueryPlan()/vacuumQueryPlanUsesIndex()helpers thatmirror the existing
ledger_range_trackerpattern.Validation
ledger-range lookups and assert the indexes are utilized (both the DELETE
predicates used by the cleaner and the SELECT equivalents).
tsc --noEmit,npm test(957 tests), andnpm run buildall pass.Also includes small repairs to pre-existing CI failures so this branch is green.
Closes 344
Closes #344