title: Better data structure than HashTable to keep track of processed records?
body: <p>I'm processing a large number of database records, each with a unique key.</p>
  
  <p>Due to the nature of my database, my processing method may encounter the same key twice since it is a relational database and one record may have more than one "parent" record.</p>
  
  <p>It is a waste of precious time, processing power, memory, and file size to process records multiple times.  Thus I need a way to keep a record of which ids I have already processed.</p>
  
  <p>I have looked at HashTable, since it is O(1) for get and put functions and those are the only functions I need.  However it seems like a waste of memory to have essentially a (1000+)/Load Factor chunk of memory essentially storing boolean values.  Plus I don't know my desired capacity and would have to put up with a lot of rehashes or allocated a lot more memory than I need.</p>
  
  <p>I think am looking for a data structure that you can add a value to it and have it give an error of some kind if the id already exists in the collection, like returning false from the <code>put(T value)</code> method. </p>