Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: char vs. varchar
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
--
![]() |
![]() |