title: Go: Efficient string lookup without hash table (aka map)?
body: <p>I have a problem in Golang whereby I need to be able to lookup string keys, from about 5,000,000 strings, each of which containing only a-z (lowercase) and 0-9 characters. Similar problem with uint32 and uint64 as keys.</p>
  
  <p>A map (hash table) is perfect for this, but it uses much too much RAM.</p>
  
  <p>There must be known methods for this type of thing, I've been looking into B-Tree but I'm not sure it would be the most efficient mechanism.</p>
  
  <p>Some of the particularities of my problem, which could lead to a more efficient solution, are:</p>
  
  <ol>
  <li>The keys need only be strings of a-z0-9 or simple uint values.</li>
  <li>Once built it only needs be read-only.</li>
  </ol>
  
  <p>Seeing as it only needs be read-only then it seems to me that having it as a pre-sorted list with a series of indexes, might work well. I thought at first I might be able to just have it in slices with a 36 (26 letters + 10 numbers) index for each level (i.e. character)... but of course that means 36^whatever which ends up being the opposite of efficient. Then I thought maybe I could put only a single index of 36 for each level, but then I end up with a load of arrays/slices that need to be intersected to get the ID of the result.</p>
  
  <p>I guess I'm looking for some kind of very specific B-Tree implementation, but more tuned to my purpose (without the B.)</p>
  
  <p>Does anyone know of anything that exists like I am suggesting?</p>