This table gets hit with this query the most, so I want add a index to speed things up, this table will have 5 million rows it in.
My query looks like this:
SELECT someID FROM someTable WHERE myVarChar = @myVarChar AND MyBit = 0 AND MyBit2 = 1 AND MyBit3 = 0
myVarChar is unique also.
What would the best index be for this type of query?
I currently have a single index that covers all of the 4 columns in the above query.
I am using sql server 2008 standard.
Do I have to reindex every so often or its automatic?