Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

should I use null or 0

659232Jun 8 2009 — edited Jun 10 2009
I am going to alter my table to add a column, IsValidFlag.
I thought I can just add a type of number(1), with value 1 or 0. Because I am sure the value is either 1 or 0.

Another developer prefer to using 1 or null. He argues that null takes less disk space than a number 0. The table is 15G, about 2 million records. Pretty big! He wants the table to take as small space as possible so the table can fit in database cache.

I think using 1 or 0 is very straightforward, while using 1 or null seems hard to understand, because null means unknown.

What is your suggestion?

Thanks in advance.

--Gary
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 8 2009
Added on Jun 8 2009
32 comments
2,058 views