Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
What is faster in a SQL Select Char or Integer?
Message
 
 
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Autre
Versions des environnements
SQL Server:
SQL Server 2005
Divers
Thread ID:
01520691
Message ID:
01520698
Vues:
37
>Gregory,
>
>I am sorry but your message is not 100% clear (and it is probably just me). You are saying the 1st but then you refer to the second case with the word "only". Could you please clarify? Thank you.

Are you expecting the field to have leading spaces?

I suggest you to try both scenarios
select fields from ... where LEN(LTRIM(CharField)) > 0

select fields from ... where IntField < 1000
and compare the execution plans (in percentage, at least).

I would expect the second to win, but it may be not as clear, so at least some testing (even with light load for now) is required from your part.

BTW, you don't need RTRIM() for the LEN function as it automatically removes trailing spaces.
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