On Mon, Aug 10, 2009 at 7:05 AM, Craig Andrews<[email protected]> wrote:
> VARCHAR is stored in the row, while TEXT is stored as a pointer to a
> separate object outside of the row. For queries where a TEXT field is in a
> WHERE clause, the query can be up to 10 times slower than those where
> VARCHAR is used instead. So I think we should use VARCHAR instead of TEXT
> here.
>
> As for the length...
>
> According to http://www.boutell.com/newfaq/misc/urllength.html different
> browsers and web servers have different max URL lengths. It seems to me
> that 2,000 characters (the limit in IE) is more than enough... so I
> suggest we use VARCHAR(2000). Honestly, if people are using URLs longer
> than 2k characters, something is clearly wrong :-)

Initially it looks like mysql only allows varchar up to 255 chars.

mysql> alter table file change url url varchar(2000);
ERROR 1071 (42000): Specified key was too long; max key length is 767 bytes
mysql> alter table file change url url varchar(256);
ERROR 1071 (42000): Specified key was too long; max key length is 767 bytes
mysql> alter table file change url url varchar(255);
Query OK, 4 rows affected (0.26 sec)
Records: 4  Duplicates: 0  Warnings: 0
_______________________________________________
Laconica-dev mailing list
[email protected]
http://mail.laconi.ca/mailman/listinfo/laconica-dev

Reply via email to