Fields with FOREIGN REFERENCES | SQL Server Performance Forums

SQL Server Performance Forum – Threads Archive

Fields with FOREIGN REFERENCES

Hi Friends, (Very New To SQL, Just learning) No 1: I am preparing my table definitions and I
am just wondering about whether all fields
with FOREIGN REFERENCES to other tables should
be indexed. (SQL Sever 2000) Any help? No. 2 What if I’ll be querying using those
fields, including them in the WHERE clause, is it
advisable to create indices for each of them?
—————————
Benson O. A.
Infinity Link Limited
Ben O. A.
No.1 : Yes. Unfortunately doesn’t SQL Server do this automatically. It’s often overlooked when establishing relations
No.2: It follows from No.1 that you already have created an index for each column. —
Frank Kalis
Microsoft SQL Server MVP
http://www.insidesql.de
Heute schon gebloggt?http://www.insidesql.de/blogs
Ich unterst�tze PASS Deutschland e.V. http://www.sqlpass.de)

Hi FrankKalis > No.1 : Yes. Unfortunately doesn’t SQL Server do this automatically. >It’s often overlooked when establishing relations May be I did not get you right Should I explicitly INDEX on those fields or SQL Server
does it implicitly when I FOREIGN REFERENCE them? Sorry Frank, I just didnt get you. But thanks for your response.
Ben O. A.
quote:Originally posted by benasumwa
Should I explicitly INDEX on those fields or SQL Server
does it implicitly when I FOREIGN REFERENCE them?
No, you have to do it yoursef by explicitly creating an index.

Thanks so much mmarovic. Ben O. A.
Sorry, if I expressed myself unclear, but mmarovic gave you the answer I had in mind. [<img src=’/community/emoticons/emotion-1.gif’ alt=’:)‘ />]<br /><br />–<br />Frank Kalis<br />Microsoft SQL Server MVP<br /<a target="_blank" href=http://www.insidesql.de>http://www.insidesql.de</a><br />Heute schon gebloggt?<a target="_blank" href=http://www.insidesql.de/blogs>http://www.insidesql.de/blogs</a><br />Ich unterst�tze PASS Deutschland e.V. <a target="_blank" href=http://www.sqlpass.de>http://www.sqlpass.de</a>)

It’s allright Frank. Ben O. A.
]]>