Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
INNER JOIN execution plans uses non primary key index
Message
De
16/02/2015 09:38:36
 
 
À
Tous
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Indexation
Titre:
INNER JOIN execution plans uses non primary key index
Versions des environnements
SQL Server:
SQL Server 2012
Application:
Web
Divers
Thread ID:
01615394
Message ID:
01615394
Vues:
29
I have seen this quite a whlie and was wondering what can be done about it.

For example, I have a select which includes four INNER JOIN into the same table. The execution plan, instead of using the join table primary key index is using a boolean index instead. This makes it, of course, less optimizable. As the INNER JOIN lines are all bound to the primary key of the joined table, why doesn't it use it?

Here is an example:
 LEFT JOIN Member ON Client.NoMember=Member.Numero
 INNER JOIN Member AS Member2 ON Client.NoMember2=Member2.Numero
 INNER JOIN Member AS Member3 ON Client.AddUser=Member3.Numero
 INNER JOIN Member AS Member4 ON Client.ModUser=Member4.Numero
In that case, the index used for the Member table is a boolean field and I had expected it would use Member.Numero.
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Répondre
Fil
Voir

Click here to load this message in the networking platform