title: What is a proper length of random code used as mysql select / join attribute
body: <p>I assign each mysql row with a random code. Only alphanumeric lowercase characters and numbers are used.</p>
  
  <p>These random codes are used for SELECT and JOIN queries.</p>
  
  <p>Most often I use length of 24 characters which gives roughly 2.2x10^37 available combinations.</p>
  
  <p>What is the perfect random code length that does not require checking for duplicates while being certain no collisions will occur but also keeping query result time to minimum?</p>
  
  <p>Note: On big tables I use INDEX for the random code column of length 24.</p>