Jump to content

  • Log In with Google      Sign In   
  • Create Account

#ActualLorenzoGatti

Posted 25 December 2012 - 02:00 AM

"I only ever access the table while searching using WHERE User1='' AND User2=''."
In this case you want an index on User1 and User2 (combined, not one on user1 and one on user2).
A clustered index would be great, but maybe you need it for the primary key (do you have one? What is it?).

#2LorenzoGatti

Posted 25 December 2012 - 01:58 AM

<blockquote class="ipsBlockquote"><p>EG: Table name = Object&lt;br /&gt;Object has two FK's: User1, User2&lt;br /&gt;I only ever access the table while searching using WHERE User1='' AND User2=''.</p></blockquote>In this case you want an index on User1 and User2, combined.&lt;br /&gt;A clustered index would be great, but maybe you need it for the primary key (do you have one? What is it?).

#1LorenzoGatti

Posted 25 December 2012 - 01:57 AM

<blockquote class="ipsBlockquote" data-author="Uthman" data-cid="5013831"><p>&nbsp;EG: Table name = Object<br />Object has two FK's: User1, User2<br />I only ever access the table while searching using WHERE User1='' AND User2=''.</p></blockquote>In this case you want an index on User1 and User2, combined.<br />A clustered index would be great, but maybe you need it for the primary key (do you have one? What is it?).

PARTNERS