[development] Form field maxlengths vs. database field sizes

Larry Garfield larry at garfieldtech.com
Mon Feb 13 19:01:13 UTC 2006


On Mon, February 13, 2006 11:07 am, Darrel O'Pry said:

> To add on...
>
> My understanding of Mysql(isam && innodb), correct me if I'm wrong, is
> that there is really no difference between the varchar(n) types and
> text. At least in terms of memory consumption/character.
> http://dev.mysql.com/doc/refman/4.1/en/storage-requirements.html
>
> I'd really prefer seeing greater text field lengths. It would close a
> few issues in the issue queue as well... Like aggregator clipping RSS
> guid's.
>
> .darrel.

That may be true, but there's a lot less that you can do with a text field
than a varchar field.  A varchar can be a key, can be indexed, and can be
used in a WHERE field='' clause.  A text field has none of those, AFAIK. 
(You can use WHERE LIKE, but not =.)  The real problem is the low
character limit on varchar in MySQL, which I believe is 255.  (Contrast to
MS SQL which is some 8 KB for an nvarchar.)

We may want to use text in more places than we do now, but it is less
flexible than varchar programmatically.

--Larry Garfield



More information about the development mailing list