Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQL brain freeze
Message
 
 
À
23/02/2017 13:35:11
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Divers
Thread ID:
01648427
Message ID:
01648431
Vues:
39
>>Since scalar functions don't play well in SQL Server, I suggest to incorporate it into your main query using OUTER APPLY, then you would be able to use ISNULL function to get the 'Unknown Store'
>
>This worked.
>However, the response was still slow.
>The store table had a non-clustered index on the storecode column.
>I changed it to a clustered index and it flies now.
>Why is there such a difference in performance between the two types on index?

Is storecode is a good candidate for such index? What kind of entries do you have?

Compare the execution plans between the 2 queries. The clustered index seek is the best for the query execution.
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