Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: What's this...varchar2 as fast as char?

Re: What's this...varchar2 as fast as char?

From: Thomas J. Kyte <tkyte_at_us.oracle.com>
Date: 1997/02/07
Message-ID: <32fa8d6b.3112215@nntp.mediasoft.net>#1/1

A char field is simply a varchar2 field that always is blank padded and consumes maximum space. A char field is treated in the database file as a varchar2 field (leading byte count followed by characters).

A char field only adds overhead, never takes less space, typically takes more space.

I have never seen a good reason to use a char field. I have seen lots of reasons not to though

I can see how a varchar2 would actually be much faster then a char. IO is reduced. Say you have a char(255) and the average length is really 80. A varchar2 field will consume 1/3 the space. 33meg vs 100meg for a full scan for example. could be a large difference.

On Thu, 06 Feb 1997 11:56:52 -0500, Sean Emery <sean.c.emery_at_bell-atl.com> wrote:

>Hello,
>
>Excuse me for bringing up a probably hashed and re-hashed argument, but
>two oracle consultants informed us that we should probably never use a
>char field because varchar2 fields are just as fast inside an Oracle DB
>and you never have to rtrim() them.
>
>This is quite contrary to what I have believed for a long time now.
>
>Does this sound accurate to you? Should I listen to these characters?
>They are _supposedly_ the experts afterall.
>
>Thank you,
>Sean

Thomas Kyte
Oracle Government
tkyte_at_us.oracle.com                          

http://govt.us.oracle.com


statements and opinions are mine and do not necessarily reflect the opinions of Oracle Corporation Received on Fri Feb 07 1997 - 00:00:00 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US