title: Optimizing chat application database
body: <p>I work on a simple chat application with database. The database for the project is shown in the image.</p>
  <p>The direction column in the message table is just to determine if user1 is the sender or user2 is the sender.</p>
  <p><img src="https://i.stack.imgur.com/UkWk1.jpg" alt="Database for chat application" /></p>
  <p>I use this query to get the messages :</p>
  <pre><code>SELECT  TextContent,Direction FROM Messages
  WHERE   User1 = 1 AND User2 = 2 
  ORDER BY Date
  </code></pre>
  <p>The values for User1 and User2 is just for clarification.</p>
  <p>I have two questions :</p>
  <ol>
  <li><p>I didn't choose a primary key for Messages table. Should I simply choose the ID column as a primary key or select multiple columns for the primary key ?</p>
  </li>
  <li><p>Should I create an index on (User1,User2,
  Date) columns or on (User1,User2,ID) columns ?. Should I create a cluster index or non-cluster index ?</p>
  </li>
  </ol>