VARCHAR versus CHAR

From a performance perspective, assuming my table might grow to a sizeable
number of entries, is it better to use VARCHAR or CHAR? Intitution says
that CHAR would obviously be faster to search through, but if I'm not using
the VARCHAR element in a WHERE clause then it's probably better to use
VARCHAR since it keeps the size of the table down and therefore more likely
to be in memory? Is this correct?

+e
The Eclectic Electric [ Do, 21 September 2006 13:40 ] [ ID #1474186 ]

Re: VARCHAR versus CHAR

The Eclectic Electric wrote:
> From a performance perspective, assuming my table might grow to a sizeable
> number of entries, is it better to use VARCHAR or CHAR? Intitution says
> that CHAR would obviously be faster to search through, but if I'm not using
> the VARCHAR element in a WHERE clause then it's probably better to use
> VARCHAR since it keeps the size of the table down and therefore more likely
> to be in memory? Is this correct?
>
> +e

Here's an excellent article on the subject:

<http://www.google.com/search?q=char+versus+varchar>
zeldorblat [ Do, 21 September 2006 16:05 ] [ ID #1474187 ]

Re: VARCHAR versus CHAR

"ZeldorBlat" <zeldorblat [at] gmail.com> wrote in message
news:1158847559.017010.65770 [at] i42g2000cwa.googlegroups.com...
>
> The Eclectic Electric wrote:
>> From a performance perspective, assuming my table might grow to a
>> sizeable
>> number of entries, is it better to use VARCHAR or CHAR? Intitution says
>> that CHAR would obviously be faster to search through, but if I'm not
>> using
>> the VARCHAR element in a WHERE clause then it's probably better to use
>> VARCHAR since it keeps the size of the table down and therefore more
>> likely
>> to be in memory? Is this correct?
>>
>> +e
>
> Here's an excellent article on the subject:
>
> <http://www.google.com/search?q=char+versus+varchar>
>

Thanks! I hope I can be as helpful to you sometime!

+e
The Eclectic Electric [ Do, 21 September 2006 17:20 ] [ ID #1474188 ]
PHP » alt.php.sql » VARCHAR versus CHAR

Vorheriges Thema: Trouble migrating from MySQL 4.0 to 5.0
Nächstes Thema: Help with query