Cardinality optimization for entity store. Able to iterate over the keys as well.