News for hackers. Stuff that matters.
Re:How does database indexing work? (2008) by efficax on Tuesday March 08, 2022 @11:09AM (#30601497)
theoretically a hash lookup is O(1) so should perform better if the key is unique, but you give up a lot of other features (like partial matches, searching, and range queries).

Binary trees are the ideal in a world of a pure von Neumann model. In practice data structures perform better when data is grouped together and this is what the b-tree gets you. It's both more disk and cache efficient in real world workflows

There are no comments on this comment yet.