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.