Data structure/algorithm for variable length record storage and lookup on disk withsearch only on primary keys

后端 未结 5 1817
感动是毒
感动是毒 2021-02-10 01:05

I am looking for an algorithm / data structure that works well for large block based devices (eg a mechanical hard drive) which is optimised for insert, get, update and delete w

5条回答
  •  有刺的猬
    2021-02-10 02:03

    If your IDs are numbers and not very sparse, one option would be to use a simple table of (offset, length) in one file, referencing the data in another file. This would get you O(1) lookup, and updates/inserts/deletes bound only by your free-space tracking mechanism.

提交回复
热议问题