Saturday 6 April 2013

What is index hint?


  I can ask this question another way

  suppose I have one table and 20 indexes are  on the table. But i want to force on query to use  index which i think it will give fast result .
  So is it possible ?

Ans - Yes. Through index hint it is possible.
     
   I think you got answer.Index hint means  forcing  query to use specified index not the index selected by query optimiser.

e,g

create table Movie(name varchar(100),id int identity(1,1))

create nonclustered index Movie_Name_I on Movie(name)

select * from name  with (index(Movie_Name_I ,nolock)) where name='xyz'

No comments:

Post a Comment