How to choose indexes for chat application database
问题 I work on a small chat application with database. I create the database shown in the image. I new to indexes and I want to choose the appropriate indexes for the query. Can I use clustered index in the Messages table ? and if I can, Which column (or columns) should have clustered index ? or should I use non-clustered index ? Update : The query that I user to get messages is : Select TextContent From Messages where (SenderId='1' and ReciverID = '2') or (SenderId='2' and ReciverID = '1') order