Re: Do null values...

From: Jurij Modic <jmodic_at_src.si>
Date: Fri, 08 Jan 1999 23:29:26 GMT
Message-ID: <369676f6.2155203_at_news.siol.net>


On Thu, 7 Jan 1999 11:32:14 -0500, "P. Larsen" <plarsen_at_ballston.uscg.mil> wrote:

>Yes, One byte (indicator). Oracle uses dynamic record sizes, so you never
>use more space than absolutely necessary.
>
>Regards
> Peter Larsen
> Senior Oracle Consultant
> lu wrote in message <3693861A.7FE9DB2F_at_igs.cviog.uga.edu>...
> take up spaces in a database, with either Oracle8 or Express Engine?
> Thanks for your help!
>
> Haoran

Well, to be more precise: NULL values do take one byte of space only if there is any non-null value stored in a column after them. If null values are stored at the end of the record, they don't take up any physical space in the database.

For example, if you have a table with columns A, B, C, D, E, F (in this order) and you enter a record with

INSERT INTO my_table (A,B,C,D,E,F) VALUES(1,NULL,3,NULL,NULL,NULL);

then only NULL value in column B will consume 1 byte of storage space in the tablespace, while NULLs in columns D, E and F will consume no space at all.

So it is a good practice to put columns with frequent null values at the end of the table.

Regards,
Jurij Modic <jmodic_at_src.si>
Certified Oracle7 DBA (OCP)



The above opinions are mine and do not represent any official standpoints of my employer Received on Sat Jan 09 1999 - 00:29:26 CET

Original text of this message