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

Home -> Community -> Usenet -> c.d.o.tools -> Re: Char vs. Varchar

Re: Char vs. Varchar

From: Mark Piffer <piffer_at_hollomey.com>
Date: Thu, 02 Nov 2000 12:17:03 GMT
Message-ID: <3a0156a5.2311707860@news.chello.at>

On Wed, 1 Nov 2000 10:50:48 -0500, "Christopher Hurley" <cphurley_at_alumni.princeton.edu> wrote:

>I am trying to decide whether to use varchar's or char's in a series of code
>tables. The codes would range from perhaps 2, 3 and maybe 4 characters in
>length, but no more. Originally, the plan was to use a char instead of
>varchar because of better performance. Is there a significant performance
>increase when using chars as opposed to varchars in lookups? Also, being
>that the length of these columns will be small, the space gained by using
>varchars will be minimal.
>
>Is there a big performance difference, and if so it what cases? If you have
>any information on this topic, I would appreciate it. Thanks.
>
>Chris
>
>

I doubt that you will win space by using VARCHAR2(4) over a CHAR(4). From what little I know, there must be a length-variable (at least 11 bits) and a indirection-variable (some sort of pointer, for sure >= 4 byte) so what you spare in characters you waste in book keeping. BTW, does somebody know how the Oracle guys do the VARCHAR2-allocation anyway? Can continuous updating of many varchar2 with changing lengths trash the performance? They should run into the same fragmentation-problems like a heap manager, shouldn't they?

regards,
Mark Received on Thu Nov 02 2000 - 06:17:03 CST

Original text of this message

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