Hacker News new | ask | show | jobs
by fnl 3263 days ago
Quick access? Tree lookup is O(log n) on a rb-tree. Hashtables are O(1). And this Diskhash thing claims to scale to billions of entries. Not sure your options are comparable, therefore.
2 comments

Claims is the operative word. Features generally aren't free. If mmap'ing files was some sort of performance godsend don't you think most DB manufacturers would just rip out all their custom caching code and replace it with mmap?
Absolutely correct! I guess a comparison with various levels of "rows" and concurrent access might be needed before judging any way...
log(billions) is not very large, constant factors matter in practice. You can also do things with trees that are very difficult with hashes (e.g. ordered traversal). This is why databases still ship with tree indices.