I have a foreign key (IdForign), and always use it in where clause.
I have three fields:
Id
Name
IdForign
How can i create the index for the Name field?
(IdForign, Name) or just one for IdForign and other for Name?
Thanks!!
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
If I undertand correctly your question, you need to create an Index only for
IdForign, because it’s the one you use in thewhereUPDATE
As per your comment, if you are using both fields I suggest you to use an index with Name and IdForign
Read this. It should give you some tips on indexing with Sql Server