
July 13th, 2004, 01:07 PM
|
|
Registered User
|
|
Join Date: Jul 2004
Posts: 6
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
Quote: | Originally Posted by DanBaker Quick Question: does the size of a varchar alter performance or storage requirement at all?
Example:
... If I have "apples" as the value.
... If the field is defined as varchar(255) or varchar(100)
... won't both definitions use the same amount of storage space?
My understanding: Doesn't the varchar size simply limit the length of the data allowed to be stored?
Thank you
Dan Baker |
Hi Dan,
One more thing, MySQL allocates the number of characters that you specify. The storage area will only be read to the end of the string. So, varchar(200) and varchar(100) will allocate different amounts of storage space. It will however, require the same ammount of time to read 'apple' from storage defined as varchar(100) or varchar(200).
PcCowboy
|