in reply to Re: Best way to look-up a string amongst 100 million of its peers
in thread Best way to look-up a string amongst 100 million of its peers

The simplest thing is to reinvent b-trees one step at a time?

-sam

  • Comment on Re^2: Best way to look-up a string amongst 100 million of its peers

Replies are listed 'Best First'.
Re^3: Best way to look-up a string amongst 100 million of its peers
by zentara (Cardinal) on Mar 26, 2008 at 18:36 UTC
    How is a b-tree simpler than breaking into smaller sorted files? I don't even know what a b-tree is.... they run me out of college before we got to that. :-) But I do know how to sort and split files.

    I'm not really a human, but I play one on earth. Cogito ergo sum a bum

      Pre-bucketing and splitting the data can have several advantages over an all-in-one-btree file. Notably, inserts can be faster because there is no rebalancing to be done. And if you split far enough to make the resultant files small, then there is no need to sort the individual files as a linear search is fast enough.

      In effect, using the first n chars to index into the appropriate bucket and then linear searching is exactly equivalent to hashing. Ie. You described the same process perl uses for its internal hashes and that CDB uses. Except the hashing part of the process is faster.


      Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
      "Science is about questioning the status quo. Questioning authority".
      In the absence of evidence, opinion is indistinguishable from prejudice.