Skip to content

Database scan improvements#4734

Merged
pwojcikdev merged 4 commits intonanocurrency:developfrom
pwojcikdev:database-scan-improvements
Sep 30, 2024
Merged

Database scan improvements#4734
pwojcikdev merged 4 commits intonanocurrency:developfrom
pwojcikdev:database-scan-improvements

Conversation

@pwojcikdev
Copy link
Copy Markdown
Contributor

This uses iterators for fetching accounts for ascending bootstrap database scan. This significantly reduces the load on the database backend in case of RocksDB.

@gr0vity-dev
Copy link
Copy Markdown
Contributor

Both RocksDB test cases show significant improvement:

  • 5n4pr_rocks_10k_change is now passing again after consistent failures
    • It completed almost 2 minutes faster than average
  • 5n4pr_rocks_10k_bintree also improved, finishing 46 seconds quicker
Screenshot 2024-09-24 at 23 35 55

@qwahzi qwahzi added this to the V28 milestone Sep 25, 2024
clemahieu
clemahieu previously approved these changes Sep 28, 2024
Copy link
Copy Markdown
Contributor

@clemahieu clemahieu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

{
pending_iterator.next (transaction);
if (!(*pending_iterator).is_zero ())
// TODO: This pending iteration heuristic should be encapsulated in a pending_iterator class and reused across other components
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this heuristic used to skip accounts with a large number of pending entries? A comment on why using sequential scanning alone is insufficient would help.

@pwojcikdev pwojcikdev merged commit 9bffe3b into nanocurrency:develop Sep 30, 2024
RickiNano pushed a commit to RickiNano/nano-node that referenced this pull request Nov 17, 2024
* Rename to `database_scan`

* More efficient database scan iteration

* Increase batch size

* Comments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Merged / V28.0

Development

Successfully merging this pull request may close these issues.

4 participants