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

Home -> Community -> Usenet -> c.d.o.misc -> Re: Space taken up by a CHAR variable

Re: Space taken up by a CHAR variable

From: Thomas Kyte <tkyte_at_us.oracle.com>
Date: 1997/04/20
Message-ID: <335b7e08.3252496@newshost>#1/1

On Sat, 19 Apr 1997 21:17:07 -0400, Tansel <tansel_at_openix.com> wrote:

>Dear Oracle Users/DBA's,
>
>My question is:
>
>What is the space taken up by a CHAR field when it is not populated,
>i.e. when it is NULL?
>This is very important for me since I have to adjust my PCT_FREE and
>PCT_USED parameters for a 15 million record file accordingly. All the
>fields in the table are CHAR's. If ,when I create the table, the
>unpopulated fields take up as much space as their size, that means when
>I update these fields in future the record size is not going to get
>bigger, which also means my PCT_FREE can be a very small number. The
>only operations on the table are UPDATEs and INSERTs.
>
>Thanks..
>
>Tansel

It will take either 0 or 1 bytes when NULL.

If it is not the last column in the table AND some column after it in the create table is NOT null it will take 1 byte.

If it is the last column in the table OR every column after it is null, then it will take zero bytes.

It will always take a fixed length when NOT null.

Thomas Kyte
tkyte_at_us.oracle.com
Oracle Government
Bethesda MD

http://govt.us.oracle.com/ -- downloadable utilities



Opinions are mine and do not necessarily reflect those of Oracle Corporation Received on Sun Apr 20 1997 - 00:00:00 CDT

Original text of this message

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