Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Parameterized index not optimized
Message
 
 
À
31/10/2011 17:34:43
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Indexation
Versions des environnements
SQL Server:
SQL Server 2008
Application:
Web
Divers
Thread ID:
01527723
Message ID:
01527736
Vues:
28
>>Make also sure that statistics are up to date.
>
>I finally found something interesting. I used to always create those index, those ones which contain several keys, by including they keys following the order of the WHERE clause. While this is good, in that particular situation, it was not as good as including the keys from the join conditions and then the WHERE clause. After I created the index, in respect to that approach, I was able to obtain an immediate result. The first one, right after I restart the SQL Server, takes about 2.5 second. I did the test several times and I was able to obtain the result. The first hit is a little bit longer so as any other hit we would do on that big table. But, the index does its job. I can see the execution plan has changed a little bit now showing more in the index seek than the lookup. It also shows that it benefits from that index.
>
>That is also by including the @Field as is in the WHERE clause, thus preserving the parameterized approach.

Since I never saw the query nor the structure of the table(s) including indexes, it's hard to comment on this approach.
If it's not broken, fix it until it is.


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

Click here to load this message in the networking platform