Repository navigation
Bound vault sweep classification reads to selected vaults - #33
Merged
Merged
Conversation
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.
Vault reconciliation can scan every sweep and probe the entire 1,000-row vault selection for each one. On production D1, a representative batch read 1,505,004 rows to return four results. Keep the selected vault batch as the outer join and seek sweeps through the existing source index; the same batch reads 3,008 rows and returns byte-identical results.
Four read-only production comparisons covered 1-, 400-, and 1,000-vault batches. Both 1,000-vault batches reduced reads by 99.8%; smaller batches kept the same read counts. No schema, classification, refresh cadence, or response changes. Tests now exercise funded and foreign vault sweeps plus an unrelated source.
Validation: root
npm run checkpassed; API suite passed (451 passed, 34 skipped). Production execution time for the first measured batch fell from 106 ms to 8 ms; the second large batch fell from 78 ms to 4 ms. Monetary savings depend on the account's D1 read allowance and actual reconciliation frequency; no monthly dollar reduction is asserted from these probes.