Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Char vs Varchar - Performance
Message
From
01/02/2005 10:51:46
 
 
To
01/02/2005 10:35:41
General information
Forum:
Microsoft SQL Server
Category:
Database design
Miscellaneous
Thread ID:
00982531
Message ID:
00982669
Views:
21
OMG, Fabio ... you are right! I did not read the whole page, just the part that pertained to the char/varchar issue ... but the guy is saying not to use NULLs and says that they are bad!!! There goes the credibility of *that* website.

I wonder if what he says about storing NULL in a char(255) column is true? He says that it will take up the entire 255 characters ... I'm wondering how a NULL can take up 255 characters? I think he's wrong about that, but I don't know for sure how SQL stores such things. Maybe Sergey knows ...

I agree with what you say about when to use varchar instead of char. I do the same thing. My only question was if there were any performance issues, and it sounds to me, from Sergey's reply, that performance issues are probably negligible, which is the assumption I've been operating on all along.

~~Bonnie



>>>>Have you seen this Bonnie?
>>>>http://www.sql-server-performance.com/datatypes.asp
>>>>
>>>
>>>Many written things are mistaken.<

>>
>>Are you agreeing with me that it's contradictory? Are you saying it's wrong? Do you have any information to answer my original question?
>>
>>~~Bonnie
>
>I don't read all, but one glanced at has been enough to me;
>I uses this simple rule:
>if it demonize the NULL, then i stop the reading.
>If one writes this on MS SQL,
>then it means that it has not understood "NULL".
>
>I have not made many tests, but i think that is difficult to confront a varchar with a char of similar dimensions and finding one meaningful difference of performances.
>Normally the data size to move is more important of the computation complexity
>(why in the normal CPU the cache it is much small and when the
>RAM is used the speed down of 10-50 times ( seek index !! ), worse for the HD);
>the complexity of a VARCHAR is much small: its length.
>
>Therefore I suggest this rule:
>If the medium length is > 90% and the variance is not excessive use a CHAR, otherwise use a VARCHAR (attention, I do not use character keys !).
>Of course, if it tightens it it must frequently concat with others,
>and it must to be RTRIMmed, then use always a VARCHAR.
>
>Pratically: i uses CHAR(N) for N<6
>
>Fabio
Bonnie Berent DeWitt
NET/C# MVP since 2003

http://geek-goddess-bonnie.blogspot.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform