title: Two columns indexed as one, or one column indexed
body: <p>What is preferred? Take two columns and INDEX them together, or create a new column and INDEX that column? For example:</p>
  
  <p><code>INDEX(user_id, key)</code></p>
  
  <p>Then run:</p>
  
  <p><code>SELECT value FROM preferences WHERE user_id = 1 AND key = 'something';</code></p>
  
  <p>Or create another column named <code>reference</code> and that would contain a value <code>1_something</code> and then run:</p>
  
  <p><code>SELECT value FROM preferences WHERE reference = '1_something';</code></p>
  
  <p>Best regards,<br>
  Andrew</p>