title: What is the principle of unique key index ？
body: <p>How does unique key index implemented?</p>
  
  <p>As I considered , if a column is defined as unique key, then every insert should first search the whole column.</p>
  
  <p>If I want to implement it by Java,I could use one kind of Set.If I load the  unique key index when I start the database, I think the memory should contain a large Set.</p>
  
  <p>EDIT: As I know , database split a big table into small table/block to store,so I should collect all the small table's distinct values into one big  Set? </p>