List:General Discussion« Previous MessageNext Message »
From:Steve Ruby Date:August 21 2000 9:59pm
Subject:Re: CHAR vs VARCHAR
View as plain text  
Christopher Thompson wrote:
> 
> > >> The big difference is speed.  CHARs are hella faster than
> > VARCHARS.  By a
> > >> lot.  CHARs take up a bit more disk space.  It's disk space
> > vs. speed.  We
> > >> choose speed for our applications.
> > >
> > > Am I incorrect in assuming that CHARs are faster only if there are no
> > > VARCHARs in the record?  In fact, isn't that one of the silent
> > type changes?
> >
> > Yes, I am sorry.  Its an all or nothing type thing.  If you have any
> > VARCHARS the whole table will slow down... and it is a sizable amount
> > according to my experiments.
> >
> 
> Given this, what is the reason to use VARCHARs instead of CHARs?
> 
> Given that the trailing spaces are removed when the value is retreived, I
> can only see the case where you want to store strings with trailing spaces
> as an instance where you would want to use VARCHAR.
> 


In the case of tables with very long variable length fields
such as TEXT and BLOB. Or in the case where you decide that the space
savings of having the variable length fields is better than the speed
gained.
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