开发者

Looking for a disk-bound b-tree example

Maybe my google-foo just isn't up to snuff, but I'm wanting to play with a b-tree alogrithm that is bound to disk. Since most tutorials and examples are on-memory, they assume random access memory in which changing nodes in a tree is simple enough, but other than rather I/O intensive rewriting or using memory-m开发者_如何学运维apped files, I can't think of a good approach.

Theory would be fine, C# or Java would be even better.

EDIT: I apologize for the lack of clarity. I am not looking for a product or code base to use, but an example or illustrative codebase to better understand how one would go about building a disk-backed b-tree.


One of the fastest Key Value DB (which also contains a Key Value DB which works with B+Trees) is Tokyo Cabinet (or Kyoto Cabinet) :). I have worked with it when I was benchmarking B+Trees and the code is easy to understand. It's written in C but it has also Java bindings... Tokyo Cabinet: http://fallabs.com/tokyocabinet/

And Berkley DB also works with a B+Tree. However, when I was benchmarking Berkley DB, it was very slow compared to Tokyo Cabinet though... http://www.oracle.com/technetwork/database/berkeleydb/overview/index.html


Firstly, see top the 2nd,3rd,4th & 5th results from google.

Secondly, see this stackoverflow thread with very similar question.

Thirdly, if you use MSSQL as an example you can read some stuff here and visualize the pages as described here (just like cache line split it's important to minimize such splits). Also MSSQL for example imposes a size limit of the data that can be indexed which is 8k = to the page size.

Fourthly, see the answer of my question which I had to ask just be able to provide this answer here Alternatively you can use a hex editor to view the database files and see how things are mapped but that's extreme.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜