title: How does using char(17) as primary key to store VIN numbers in a table with SQL Server affect performance?
body: <p>I am designing a database with a table to store vehicles and since the vehicle identification number is a 17 digit alphanumeric serial number my idea is to use it as the primary key, with a datatype of <code>char(17)</code>. </p>
  
  <p>Numerous other tables will then have the VIN as a foreign key.</p>
  
  <p>A number of queries/searches will run with the VIN number as parameter since it's how we would like to track the vehicles as well as other data related to it.</p>
  
  <p>The VIN number will never change, but I'm unsure if it would cause any serious performance degradation (or other complications I'm not aware of) since some queries will use joins and others not :/  </p>
  
  <p>By using the VIN as primary key I do not have to create a unique constraint / additional index - BUT it has to be <code>char(17)</code> a data type other than <code>int</code> for which primary keys are supposedly optimized...</p>
  
  <p>What I'm also not 200% sure of is that every VIN number out there is the same length (very unlikely) but in that case how would using a <code>varchar(17)</code> affect the whole situation... if at all.</p>
  
  <p>Thanks!</p>