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: char vs. varchar

Re: char vs. varchar

From: Connor McDonald <mcdonald.connor.cs_at_bhp.com.au>
Date: Mon, 11 Jan 1999 11:36:35 +0800
Message-ID: <369971C3.5366@bhp.com.au>


dperez_at_juno_nospam.com wrote:
>
> I was told by one of my DBA instructors that whenever possible varchar should be
> used. Supposedly it is much quicker to read or write varchars than to retrieve
> or write the fixed length chars.........
>
> BUT, one question I've always wondered about is if the system doesn't know how
> long a varchar is going to be, and it only allocates the space in the record for
> whatever the original size of the field is, then if the field length is
> increased doesn't the database have to store the additional characters in an
> overflow area of the block? In which case it would have to do MORE I/Os...
>
> In any case, my recollection is the system is optimized to use varchars........

If a row gets bigger (due to lengthening a varchar2 for example), then the row can be moved to another area in the block - read your doco on the PCTFREE parameter for tables...

If its runs out of space in the same block - it will be migrated to another block - this is called chaining...Lots of chaining can hurt your index read performance (but will not harm full table scans)

Cheers
--



Connor McDonald
BHP Information Technology
Perth, Western Australia
"The difference between me and a madman is that I am not mad" Received on Sun Jan 10 1999 - 21:36:35 CST

Original text of this message

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