Searcheable BTree

Chris Muller afunkyobject at yahoo.com
Wed Sep 15 04:43:46 UTC 2004


> for a BTree, a message like 
>    
>    >>keysStartingWith: aString 
> 
>    that returns a set of keys will be *very* useful.

Hi Sebastian, please excuse me if I've misunderstood what you're looking for. 
MaHashIndex *may* be an example of what you're looking for.

Here are some of its characteristics to help you determine whether it is
suitable.

  - supports key sizes from 32 to 256 bits, values are only 64 bits
  - provides key-order enumeration from any key or absolute-position
  - key and absolute-position access is very fast, insertion is pretty slow,
removal is very slow.
  - supports duplicate keys
  - includes *extensive* test cases that demonstrate its capability and
correctness

Here is some of the main public api:

  includesKey: keyInteger
  indexOf: keyInteger  "answers the absolute position of the lowest of that
key"
  numberOfEntriesFrom: lowKey to: highKey
  occurrencesOf: keyInteger
  size
  upTo: count keysFromIndex: "absolute" startPosition
  upTo: count oidsFrom: lowKey to: highKey
  upTo: count oidsFromIndex: "absolute" startPosition

It maintains a randomly-accessed file for its storage and no reorganization is
ever needed since it happens dynamically.

The test cases do take a while to run because they are quite stringent and
extensive.

Cheers,
  Chris



More information about the Squeak-dev mailing list