Question on Index usage

  • Hi All,

     I have an index consisting of three columns of a table say col A,B and C.

    If my query uses only col A , or only col A and B in the where clause , will the above index be utilized by the query?

     

     

    Thanks,

    Rajesh

  • Yes

    Provided your query uses Col A the index will be used.

  • Thanks for the responding to my post.

     

     

     

  • The answer is "maybe".

    It depends on type of index and data distribution. If you query on A, and there are large numbers of repeating values of A in the index, and the index is non-clustered, the optimizer may decide it is not selective enough and not use the index.

     

  • The answer is "maybe".

    It depends on type of index and data distribution. If you query on A, and there are large numbers of repeating values of A in the index, and the index is non-clustered, the optimizer may decide it is not selective enough and not use the index.

     

     

    Good to know this fact. I'll definitely keep this in mind.

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply