I know the importance of indexes and how order of joins can change performance. I\'ve done a bunch of reading related to multi-column indexes and haven\'t found the answer t
The general rule is that in a multi-column index, you want to put the most selective -- that is, the one that will give you fewest results -- first. So if you are creating a multiple-column index on a table with a status
column of say 10 possible values, and also a dateAdded
column, and you're typically writing queries like
SELECT * FROM myTable WHERE status='active' and dateAdded='2010-10-01'
...then you'd want dateAdded
first, because that would limit the scan to just a few rows rather than 10% (or whatever proportion are 'active') of your rows.
This takes a fair bit of thought and tuning; you should check out the Lahdenmaki and Leach book.