Skip to content

Split Block table #4053

@clemahieu

Description

@clemahieu

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    databaseRelates to lmdb or rocksdbdatabase structureIf the database changes it needs updating in the nanodb repository

    Type

    No type

    Projects

    Status

    In Progress / V28.0

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions