Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Foreign key on two fields
Message
 
 
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Autre
Versions des environnements
SQL Server:
SQL Server 2005
Divers
Thread ID:
01520713
Message ID:
01520720
Vues:
26
>>It should be one index per both fields. I suggest to make integer field first key and char the second in the list of fields.
>>This is assuming you always use both fields in join conditions and select filters.
>
>Sorry to bug you again with my silly questions. Why is it important that the Integer field is the first key and not the other way around?

I was thinking that since integer field is sequential, it may help to have it this way, although I may be wrong.

Say, clustered index is good when it's done on the identity fields - there are no page splits.

Also, if you always insert integer values in ascending order (e.g. if they are increasing integers), then it will help.

If you will insert 5, then 1, then 7, etc., then it will not matter.

I know you said you don't have much time, but there is a great video on the topic of indexes by Kimberly Tripp - wish I remember a link to that.

Try googling for now 'Indexes fundamentals Kimberly Tripp'.
If it's not broken, fix it until it is.


My Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform