On Tue, Aug 11, 2009 at 9:39 AM, Brenda Wallace<[email protected]> wrote:
> 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

No, they can be longer, but not if you want them indexed.
If i drop the unique contraint then mysql lets me make 2000 char varchars.

How about we stick with saving the shortened url whenever it's > 255 chars?

The down side is, i'm predicting these url shortening services are
gonna start disappearing slowly and the urls will become dead.


-- 
www.br3nda.com
www.coffee.geek.nz
"Support living artists - the dead ones don't need it." - Collette Rene Fergus
_______________________________________________
Laconica-dev mailing list
[email protected]
http://mail.laconi.ca/mailman/listinfo/laconica-dev

Reply via email to