Scans each storage only once when building accounts index#6745
Merged
brooksprumo merged 2 commits intoanza-xyz:masterfrom Jun 26, 2025
Merged
Scans each storage only once when building accounts index#6745brooksprumo merged 2 commits intoanza-xyz:masterfrom
brooksprumo merged 2 commits intoanza-xyz:masterfrom
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #6745 +/- ##
=======================================
Coverage 83.3% 83.3%
=======================================
Files 852 852
Lines 378005 378020 +15
=======================================
+ Hits 315220 315251 +31
+ Misses 62785 62769 -16 🚀 New features to boost your workflow:
|
5efda19 to
6d27040
Compare
brooksprumo
commented
Jun 26, 2025
t-nelson
reviewed
Jun 26, 2025
t-nelson
approved these changes
Jun 26, 2025
roryharr
approved these changes
Jun 26, 2025
|
Backports to the beta branch are to be avoided unless absolutely necessary for fixing bugs, security issues, and perf regressions. Changes intended for backport should be structured such that a minimum effective diff can be committed separately from any refactoring, plumbing, cleanup, etc that are not strictly necessary to achieve the goal. Any of the latter should go only into master and ride the normal stabilization schedule. Exceptions include CI/metrics changes, CLI improvements and documentation updates on a case by case basis. |
mergify Bot
pushed a commit
that referenced
this pull request
Jul 9, 2025
(cherry picked from commit cfa4c2c)
brooksprumo
added a commit
that referenced
this pull request
Jul 10, 2025
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.
Problem
When building the accounts index, if secondary indexes are on, we scan each account storage file twice. This is bad, performance wise. The second scan is needed to get each account's data, which secondary indexes need.
We should switch on if secondary indexes are enabled or not, and then decide how to scan the storage. E.g. if secondary indexes are on, scan once with account data. If secondary indexes are off, scan once without account data.
Summary of Changes
Instead of scanning twice, only scan once! Pick the scan function depending on if secondary indexes are on or off.