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: keith boulton <boulke_at_globalnet.co.uk>
Date: Sun, 10 Jan 1999 10:17:29 GMT
Message-ID: <36987b9a.1392622@read.news.globalnet.co.uk>


On Sat, 09 Jan 1999 02:54:00 GMT, dperez_at_juno_nospam.com wrote:

>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...
>

Varchar and char are stored internally in the same way. The only difference is that data is padded in char datatypes before being stored.

If a varchar2 field is increased in length, the row will expand. This is the reason why there is a pctfree storage parameter to allow for this growth. If the row can no longer fit in the data block, it is moved to a different block and a pointer is left in the original block. Retrieving the row will then require two IOs instead of one. Received on Sun Jan 10 1999 - 04:17:29 CST

Original text of this message

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