Split Block table #4053
Labels
database structure
If the database changes it needs updating in the nanodb repository
database
Relates to lmdb or rocksdb
Milestone
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.
The text was updated successfully, but these errors were encountered: