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

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

From: Galen Boyer <galenboyer_at_hotpop.com>
Date: 23 Aug 2001 14:58:10 -0500
Message-ID: <uae0qfkql.fsf_-_@verizon.net>


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.
Received on Thu Aug 23 2001 - 14:58:10 CDT

Original text of this message

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