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: Varchar(1) or char(1) (WAS) Re: How insert new field in between?

Re: Varchar(1) or char(1) (WAS) Re: How insert new field in between?

From: Connor McDonald <connor_mcdonald_at_yahoo.com>
Date: Fri, 24 Aug 2001 10:18:12 +0100
Message-ID: <3B861BD4.294A@yahoo.com>


Galen Boyer wrote:
>
> On 23 Aug 2001, mark.powell_at_eds.com wrote:
>
> > There is no reason not to use varchar2(1) instead of char(1).
> > Oracle support had a recent thread where they stated both
> > columns will require the same amount of internal storage.
>
> Hm... The way I understood varchar2() there is a performance
> penalty when compared to char() because Oracle has to store an
> extra character on the row for each varchar2() column to define
> how big the stored field of varchar2() for that row was. Then,
> Oracle would know how to read across the row and grab the correct
> set of bytes. With a char(x), Oracle already knows. Therefore,
> char(x) would be faster for retrieval and where clause
> restriction but very limiting in functionality.
>
> Maybe varchar2(1) gets resolved to char(1) and then no
> performance penalty? (Of course, assuming that there is a
> performance penalty in the first place)
>
> --
> Galen Boyer
> It seems to me, I remember every single thing I know.

Internally CHAR and VARCHAR2 are stored identically (both data and length of the data).

hth
connor

-- 
==============================
Connor McDonald

http://www.oracledba.co.uk

"Some days you're the pigeon, some days you're the statue..."
Received on Fri Aug 24 2001 - 04:18:12 CDT

Original text of this message

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