title: Do SQL tables benefit or need to have a unique ID column?
body: <p>In my experience almost all tables have a field called Id that is a unique primary key and indexed.  My question is if I'm not using this value anywhere and will never need this value what is the benefit of having it.</p>
  
  <p>Here is my problem:</p>
  
  <p>The database has these many-many relationship tables (often called map tables) that link two other tables together by their unique Ids.</p>
  
  <p>ex rows:</p>
  
  <p>Id= 1 MachineId= 1 UserId= 2</p>
  
  <p>Id= 2 MachineId= 1 UserId= 3</p>
  
  <p>The way the code stands today when it updates this table it removes all Users of a machine and then proceeds to add all of the current users back.  This is how they chose to remove old entries.  The problem is this inflates the Id column unnecessarily because you remove/add for every user even if nothings changed.  This happens by default every 90mins.</p>
  
  <p>One solution to this is to fix the code to do things the right way.  Another solution is to just remove the Id field altogether.  Since we don't link to this table somewhere else and we don't use the Id value in code anywhere (we don't even pull it from the DB) why do we need it?</p>
  
  <p>So back to my original question.  Is the Id field needed for something else?  Or does it provide some benefit that I would lose that I may want?</p>