Christoph Weser > 
> Hello!
> 
> Hope this question isn't answered 1000-times, but I haven't 
> found anything
> in the list archive.
> 
> I create the test table:
> 
> create table testtable (
>        test varchar(100) not null,
> )
> 
> The question: 
> Will this 100 Byte be allocated (or something like that) 
> before Usage, or is
> it really complete dynamical, like the name suggests?

dynamical, if we talk about NON-primary key columns
or the LAST primary key column.


> In the theoretical case, that in every row, only the first 10 
> bytes will be
> used, would there be any difference using:
> 
>       test varchar(100) not null,
> 
> and 
>       test varchar(1000) not null,
> 
> concerning memory consumption and stuff?

yes, there is a difference according to
http://www.mysql.com/documentation/maxdb/ff/baaba8d55a11d2a97400a0c9449261/frameset.htm
meaning that a column where the maximum length is <= 254, 1 byte for the real length 
of the
data is used, for a column where the maximum length may exceed 254 (as your 1000) 2 
bytes
will be used (for EVERY value in that column, not matter how long this value is! ) for 
specifying
the real length of the data.

Elke
SAP Labs Berlin

> 
> Thanx a lot!
> 
> 
> -- 
> MaxDB Discussion Mailing List
> For list archives: http://lists.mysql.com/maxdb
> To unsubscribe:    
> http://lists.mysql.com/[EMAIL PROTECTED]
> 

-- 
MaxDB Discussion Mailing List
For list archives: http://lists.mysql.com/maxdb
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to