> Your mail suggests that you *are* seeing a difference, though. What
> are you seeing?
What I was saying, is that VARCHAR takes up space "l" (= length)
of the data plus 1 or 2 bytes to store the length, while CHAR takes
up the full space of the -defined- column size.
This is rather wasteful when storing CHAR data that doesn't take up
the full available space (as this is padded with spaces up to the defined
length) and is a storage engine "feature" ;-)
Download Database Workbench for Oracle, MS SQL Server, Sybase SQL
Anywhere, MySQL, InterBase, NexusDB and Firebird!
Database questions? Check the forum:
> On 11/11/09, Martijn Tonies <m.tonies@stripped> wrote:
>>>You have stumbled across the secret. No, there is no difference at
>>>all as the calculations suggested here confirm.
>> Note: as you can see in the above, CHAR data DOES take up room for it's
>> full size, stupidly enough.
>> On Tue, Nov 10, 2009 at 6:37 PM, Waynn Lue <waynnlue@stripped> wrote:
>>> Hey all,
>>> I was building a table for storing email addresses today and ran into an
>>> issue that I couldn't find an answer for using Google. If I declare the
>>> column as a VARCHAR (this is an InnoDB table), does it matter what size
>>> declare it as if it's between 1 and 255? I know there's an extra byte of
>>> storage once it goes above 255 because of the length, but is there a
>>> difference between VARCHAR(100) and VARCHAR(255)? Obviously there's a
>>> functional difference in what gets cut off when I try to store into that
>>> table, but is that the only difference?
>> With regards,
>> Martijn Tonies
>> Upscene Productions
>> Download Database Workbench for Oracle, MS SQL Server, Sybase SQL
>> Anywhere, MySQL, InterBase, NexusDB and Firebird!
>> Database questions? Check the forum:
>> MySQL General Mailing List
>> For list archives: http://lists.mysql.com/mysql
>> To unsubscribe: http://lists.mysql.com/mysql?unsub=1