title: mongodb index data structures
body: <p>Does mongodb discriminate between indices constructed of small, statically sized elements (lets say numeric types) and those with large variant types (such as strings) ? </p>
  
  <p>From the BSON spec I can see that BSON does show the capacity of special treatment of integral types. I would expect the indexing code to create more performant indices if the index contains only int64's.</p>
  
  <p>Perhaps it has some form of discriminated union ? </p>