[thelist] (no subject)

Jon Haworth jhaworth at witanjardine.co.uk
Fri May 24 09:50:08 CDT 2002


Hi Carol,

> One of the advantages of this, of course, is that your
> actual data can take up exactly as much room as it needs,
> and no more. You don't have to allocate to all fields the
> length the largest value will need. Does MySQL, SQL, or
> any other DB Package have this feature yet?

Of course they do, and have done for many many years.

CREATE TABLE testTable (testField varchar(23))

You now have a variable-length column, which will take 1 to 23 chars and
store them using only the space necessary.

AIUI there are performance benefits to using fixed-length columns, so if you
know that all data will be the same length (e.g. MD5 hashes of 32
characters), then it makes sense to use CHAR instead of VARCHAR.

Cheers
Jon



More information about the thelist mailing list