title: MySQL Unique Multicolumn Index
body: <p>Here is the scenario</p>
  
  <p>In a CMS-like system that I am building I have to incorporate the ability to serve up different page content based on the IP location of the viewer.  To that end I have a MySQL table that contains, amongst other things, the columns</p>
  
  <pre>
  page - varchar (holds actual page content)
  ciso - char(3) (holds an ISO country code)
  </pre>
  
  <p>When it is all working I should be able to have table entries along the lines of </p>
  
  <pre>
  page     ciso
  --------------
  lander   AUS
  lander   USA
  lander   FRA
  ....
  </pre>
  
  <p>What I want to be able to do is to ensure that each page/ciso pair is treated as a unique entry.  My MySQL skills are pretty basic - I use Indexes and I am aware that you can index on multiple columns but I have never used the capability (nor up to this point really appreciated why it might ever be needed).  </p>
  
  <p>I guess I could just suck it and see but it would be useful to know if an index on page &amp; ciso will deliver the behavior I would like to see.  If so, are there any downsides to doing this?  If not, what other routes do I have (apart from using a unique autoincrementing row id column).  I'd much appreciate any help.</p>