Giter VIP home page Giter VIP logo

Comments (1)

petermattis avatar petermattis commented on August 20, 2024

RocksDB includes metadata_block_size option to control the size of the first level index blocks (default 4KB). Something to pay attention to here is what happens with large keys. Consider a config with a block size of 4KB and metadata block size of 4KB. If a key is 4KB then each block will contain a single key, and each metadata block will contain a single key, and the root index block will end up containing all keys in the table.

Rather than a fixed number of index levels, perhaps we should support an arbitrary number and make the sstable act much more like an immutable btree. The leaf blocks would contain data. The index blocks would contain keys and pointers to either other index blocks or leaf blocks. We'd target the index blocks to the same size as the leaf blocks, but require them to hold at least 2 entries so that some amount of fanout is guaranteed.

Creation of this multi-level index shouldn't be too complicated. We build up the first level index blocks as that data blocks are being written. Then we loop over the first level index blocks and build up the next level. If there is more than one index block at this level we iterate building up more levels until there is a single root index block. We'd need to add a bit of sstable metadata indicating the number of levels.

Cc @ajkr

from pebble.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.