Re: design question

From: DA Morgan <damorgan_at_psoug.org>
Date: Sun, 07 Sep 2008 11:20:00 -0700
Message-ID: <1220811598.611595@bubbleator.drizzle.com>


Chris Seidel wrote:
> DA Morgan wrote:
>

>> Most things have NULL columns ... what's the issue?

>
> A table with lets say 100 columns and 90 % NULLs in each row is no problem
> for the database performance and storage?

You are thinking horizontally when you should be thinking vertically.

Consider the following two tables.

CREATE TABLE t1 (
rid NUMBER,

attr001 VARCHAR2(5),
attr002 VARCHAR2(5),
attr003 VARCHAR2(5),
...     VARCHAR2(5),
attr100 VARCHAR2(5));

CREATE TABLE t2 (
rid     NUMBER,

attrnum NUMBER(3),
attrval VARCHAR2(5));

One is well designed ... the other a nightmare. And has nothing to do the question of NULLs. Reconsider the way you are approaching the problem.

And I am in complete agreement with hpuxrac. VARCHAR2(4000) does not belong in any database for the purpose you seem to be intending.

-- 
Daniel A. Morgan
Oracle Ace Director & Instructor
University of Washington
damorgan_at_x.washington.edu (replace x with u to respond)
Puget Sound Oracle Users Group
www.psoug.org
Received on Sun Sep 07 2008 - 13:20:00 CDT

Original text of this message