List:General Discussion« Previous MessageNext Message »
From:Christophe Barbe Date:October 8 2002 3:47pm
Subject:Re: CHAR vs. VARCHAR
View as plain text  
Le mar 08/10/2002 à 11:35, Michael T. Babcock a écrit :
> Before I forget: SQL, QUERY ... going write a filter for these some day ...

I don't get what you mean by "SQL, QUERY ...".
I know how to write a SQL QUERY.

I am looking about experienced pros and cons on the use of VARCHAR. My
understanding is that, except if you know that each time the text will
have the same length, VARCHAR is better. This seems a bit too perfect to
be true.

Also I am wondering about the tradeof between using a separate table for
rare comments (ie. most of the time empty) and the use of a VARCHAR
which use only one byte to store an empty comment.

Christophe

> christophe barbe wrote:
> 
> >What are the disadvantages of using VARCHAR instead of CHAR.
> >Is it going to be considerably slower? 
> >  
> >
> It really depends on your table, but if you find it slower, break down 
> into multiple tables:
> 
> create table FeedbackForm (
>     ID int unsigned, Name char(50), Address char(50), FeedbackCommentID 
> int unsigned
> );
> create table FeedbackComment (
>     ID int unsigned, Comment blob
> );
> 
> Then your searches through the FeedbackForm are good and fast, and 
> finding the correct Feedback Comments isn't so bad either, but not _as_ 
> fast.
> 
> BTW, SQL ... QUERY ... bah ...
> 
> -- 
> Michael T. Babcock
> C.T.O., FibreSpeed Ltd.
> http://www.fibrespeed.net/~mbabcock
> 
-- 
Christophe Barbé <christophe.barbe@stripped>
GnuPG FingerPrint: E0F6 FADF 2A5C F072 6AF8  F67A 8F45 2F1E D72C B41E
Thread
CHAR vs. VARCHARchristophe barbe8 Oct
  • Re: CHAR vs. VARCHARMichael T. Babcock8 Oct
    • Re: CHAR vs. VARCHARChristophe Barbe8 Oct
  • Re: CHAR vs. VARCHARMichael T. Babcock8 Oct
  • Re: CHAR vs. VARCHARMichael T. Babcock8 Oct
  • Re: CHAR vs. VARCHARBrent Baisley8 Oct
    • Re: CHAR vs. VARCHARChristophe BarbĂ©8 Oct
    • Re: CHAR vs. VARCHARchristophe barbe8 Oct
Re: CHAR vs. VARCHARJan Steinman9 Oct