Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Split Block table #4053

Open
clemahieu opened this issue Jan 14, 2023 · 2 comments
Open

Split Block table #4053

clemahieu opened this issue Jan 14, 2023 · 2 comments
Labels
database structure If the database changes it needs updating in the nanodb repository database Relates to lmdb or rocksdb
Milestone

Comments

@clemahieu
Copy link
Contributor

Currently the block table maps block_hash -> block data. Each block is keyed on random data which causes frequent database page splits, hurting performance and causing internal fragmentation. For highest performance and lowest internal fragmentation, the database should append data whenever possible.

Splitting the block table in to one table mapping block_hash -> index and another table mapping index -> block_data significantly reduces the amount of fragmented data. Initial tests show disk space saving up to 50%, a speed up for non-seeking disks, and a significant speed up for seeking disks (HDDs).

Organizing blocks this way has the side effect of providing a topology sort of blocks which can be used for incremental ledger snapshots.

@My1
Copy link

My1 commented Jan 15, 2023

Initial tests show disk space saving up to 50%, a speed up for non-seeking disks, and a significant speed up for seeking disks (HDDs).

this is awesome to be honest especially for the smaller nodes.

Organizing blocks this way has the side effect of providing a topology sort of blocks which can be used for incremental ledger snapshots.

this is also very cool.

@qwahzi qwahzi added this to the Backlog milestone Jan 17, 2023
@clemahieu clemahieu modified the milestones: Backlog, V26.0 Apr 21, 2023
@qwahzi
Copy link
Collaborator

qwahzi commented Sep 25, 2023

Related draft/work-in-progress PR for review & feedback: #4295

@qwahzi qwahzi added database Relates to lmdb or rocksdb database structure If the database changes it needs updating in the nanodb repository labels Sep 27, 2023
@qwahzi qwahzi modified the milestones: V26.0, Todo Nov 20, 2023
@qwahzi qwahzi moved this to Future / V28.0 in Nano Roadmap Jul 2, 2024
@qwahzi qwahzi moved this from Future / V28.0 to In Progress / V27.0 in Nano Roadmap Aug 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
database structure If the database changes it needs updating in the nanodb repository database Relates to lmdb or rocksdb
Projects
Status: In Progress / V28.0
Development

No branches or pull requests

3 participants