Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Optimization in this query
Message
 
 
À
18/02/2010 20:48:53
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Versions des environnements
SQL Server:
SQL Server 2008
Application:
Web
Divers
Thread ID:
01449844
Message ID:
01449849
Vues:
54
This message has been marked as the solution to the initial question of the thread.
>>What is the PK of the table?
>
>Thread.Numero is the primary key.
>
>>You may try
>>
>>select Thread.AddDate,Thread.Numero,Thread.Title,Thread.Url from Thread (NOLOCK) 
>>inner join (select top (10) Numero from  Thread (NOLOCK)
>>WHERE Thread.NoMember=@NoMember AND Thread.AddDate>@AddDate 
>>ORDER BY Thread.Numero DESC) X on Thread. Numero = X.Numero -- Assuming Numero is a PK
>
>Thanks, by doing this, I obtain the new execution plan. See attached. By interpreting that, does this mean this new execution plan is more optimized than the previous one?

Did you try running both queries and see how much in % to total time each query cost? The Key Lookup seems to be the slowest one. What indexes do you have in your table? May be we need one with Numero and include Column AddDate ?
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