It's probably faster to retrieve from a varchar field than a mediumtext 
field, but any benefit is completely erased by the need to perform an 
"OR" query to search in both fields.

Your biggest speed benefit can actually be attained by avoiding varchar 
and text fields altogether, use char(). This will cause each record to 
be exactly the same length, which will allow MySQL to "jump" to spot in 
the file quicker. It's less efficient on space usage, but storage is 
cheap.

On Wednesday, September 25, 2002, at 01:48 PM, Derek Scruggs wrote:

> Hi All,
>
> I've built a survey application in MySQL that allows people to enter
> free-form comments. In processing the input, if the comments string is 
> less
> than 256 characters long, I save it to a varchar column; if longer, I 
> use a
> mediumtext.
>
> This works fine, but I'm wondering if I'm getting any real value from 
> it. Is
> it inherently faster to retrieve varchars than mediumtext, even if the
> mediumtext is holding small (<256 characters) values? What about for
> searching on these field types?
>
> -Derek
>
> ---------------------------------------------------------------------
> Before posting, please check:
>    http://www.mysql.com/manual.php   (the manual)
>    http://lists.mysql.com/           (the list archive)
>
> To request this thread, e-mail <[EMAIL PROTECTED]>
> To unsubscribe, e-mail <mysql-unsubscribe-
> [EMAIL PROTECTED]>
> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
>
>
--
Brent Baisley
Systems Architect
Landover Associates, Inc.
Search & Advisory Services for Advanced Technology Environments
p: 212.759.6400/800.759.0577


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to