List:General Discussion« Previous MessageNext Message »
From:Ed Wang Date:August 21 2000 6:45pm
Subject:Re: CHAR vs VARCHAR
View as plain text  
However, if I recall in the manual correctly, if you have one VARCHAR
field in your table, it effectively makes the entire row variable
length, so all the CHARs become VARCHARS internally.

OK, I found it.  To quote section 7.7.1:
    If any column in a table has a variable length, the entire row is
    variable-length as a result. Therefore, if a table contains any
    variable-length columns (VARCHAR, TEXT or BLOB), all CHAR columns
    longer than three characters are changed to VARCHAR columns.

	- Ed Wang
-- 
Software Engineer
ed@stripped
HomePage.com


Rob McMillin wrote:
> 
> Claude Cormier wrote:
> 
> > Unless you need a small text column or the data entered will always
> have
> > a fixed number of characters, is there a good reason for not using
> > VARCHAR all the time instead of CHAR?
> 
> According to the docs, CHAR is faster because the rowsizes are all the
> same. I have to wonder about this, because accessing a larger table (and
> tables made up
> of strictly CHAR types would be sizeably larger) is generally slower.
> 
> --
>           http://www.pricegrabber.com | Dog is my co-pilot.
Thread
CHAR vs VARCHARClaude Cormier21 Aug
  • Re: CHAR vs VARCHARRob McMillin21 Aug
  • Re: CHAR vs VARCHARClaude Cormier21 Aug
    • RE: CHAR vs VARCHARSander Pilon21 Aug
  • Re: CHAR vs VARCHARKris Dahl21 Aug
    • Re: CHAR vs VARCHARJan Dvorak21 Aug
      • Re: CHAR vs VARCHARKris Dahl22 Aug
  • Re: CHAR vs VARCHAREd Wang21 Aug
Re: CHAR vs VARCHARKris Dahl21 Aug
  • RE: CHAR vs VARCHARChristopher Thompson21 Aug
    • RE: CHAR vs VARCHARDana Powers21 Aug
    • Re: CHAR vs VARCHARSteve Ruby21 Aug
  • Fastest way to select setsChristopher Thompson21 Aug
    • Re: Fastest way to select setsSteve Ruby22 Aug
    • Re: Fastest way to select setsTonu Samuel22 Aug
      • Re: Fastest way to select setsTino Hendricks28 Aug
        • Re: Fastest way to select setsTonu Samuel2 Sep
Re: CHAR vs VARCHARPaul Schmidt22 Aug