Indexes…. | SQL Server Performance Forums

SQL Server Performance Forum – Threads Archive

Indexes….

If I create an index on column a, column b and column c and then query the table using column a and column b in the where clause, will it still use the index? Hmmmm……..
Normally if you have index defined on your table , SQL use them. Have a look at your execution plan to see whether indexes are used. AKTHAR DILMOHAMUD
65 BENARES ST
PORT LOUIS
MAURITIUS
If the order of the columns in the index definition is A, B, C then yes, SQL is very likely to use the index. It also depends on the criteria being "sargable".
Can you post the query you are firing.
It also uses it depending on the query whether its sargable or non-sargable.
If it is then you can even specify the with(index=name) hint to force the use of index.
Yes it will use as the column A & B are in the index, certainly the query statement will give more information about what you’re using and can be achieved. Satya SKJ
Moderator
http://www.SQL-Server-Performance.Com/forum
This posting is provided “AS IS” with no rights for the sake of knowledge sharing.
]]>