sql server - Adding a index on my table for this query -


I have a 5 million row table which becomes the biggest hit with a specific query, so I can speed things up

query:

  select something from where my works = @MyWarKar and Mibit = 0 and MyBit2 = 1 and MyBit3 = 0  

Note, the myVarChar column is unique.

What would be the best index for this type of query? Currently I have an index that covers all 4 columns in the above query. Also, do I have to recondition it again or again?

I am using the SQL Server 2008 standard.

Is some table the primary key of that table? If not, you should add it to your index to prevent bookmark search.

Also, look at the execution plan for that query, if your index is created properly, then you should see two icons in the execution plan: choose and get an index.


Comments