|
|
 |
Re: FN-FORUM: MySQL data types and lengths
date posted 5th January 2007 19:15
> The client asked why i couldnt make them all as large fields (TEXT) , it
> kind of threw me as i didn't really know why, i have just done it out of
> habit.
>
> I know there is a valid reason.. somewhere. Thoughts? :)
There are some differences to do with indexing and the ability to have a
default value. A TEXT is also stored differently, which might have
performance and space implications for very large tables. A VARCHAR of
less than 255 only takes size+1 bytes for storage, a TEXT takes size+2
bytes. Probably not an issue unless you have millions of short strings to
store.
http://dev.mysql.com/doc/refman/5.0/en/blob.html
http://dev.mysql.com/doc/refman/5.0/en/storage-requirements.html
Cheers!
Anthony
--
www.fonant.com - Quality web sites
|
 |
|