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 :-)

How's that sound?
~Craig

> On Thu, Aug 6, 2009 at 7:32 PM, Andreas Schildbach<[email protected]>
> wrote:
>> On Thu, 2009-08-06 at 15:04 +1200, Brenda Wallace wrote:
>>
>>> on the table "file" the column "url"  is a varchar(255)
>>>
>>> for postgres, I can change this column to a type "text", and it's
>>> solved.
>>> i understand mysql is really slow at handling "text" columns, so i'm
>>> unsure if we can do the same there.
>>
>> Mysql 5.0.3 and above allows for up to VARCHAR(65535).
>>
>> http://dev.mysql.com/doc/refman/5.0/en/char.html
>
> So how would we like to handle mysql? I don't know enough about
> scaling a mysql database to make this call.
> I have a commit to make this work in postgresql again - I'll push this
> on it's own if we just want to leave mysql truncating.
>
> The url that triggered this is someone giving an example of XSS -
> hence the url was very long to include all the javascript to be
> injected. I reckon this is a valid use of laconica as a communications
> platform, so I definitely want very very long urls to work for mysql
> users too.
> _______________________________________________
> Laconica-dev mailing list
> [email protected]
> http://mail.laconi.ca/mailman/listinfo/laconica-dev
>


_______________________________________________
Laconica-dev mailing list
[email protected]
http://mail.laconi.ca/mailman/listinfo/laconica-dev

Reply via email to