dbTalk Databases Forums  

Defaulting ALL database columns in ALL tables - not allowing any NULL values...???

comp.databases comp.databases


Discuss Defaulting ALL database columns in ALL tables - not allowing any NULL values...??? in the comp.databases forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
DaFrizzler
 
Posts: n/a

Default Defaulting ALL database columns in ALL tables - not allowing any NULL values...??? - 01-23-2007 , 08:42 AM






Hi, I have received the following email from a colleague, and am quite
frankly baffled by the idea.

I am just wondering if anyone has any advice or suggestions about
this????

=== BEGIN MAIL ===
The DB2 DBA has requested that all columns in the tables be defined as
not null with default to improve storage, performance, and ease of
backup/recovery. Currently there are several columns in each table
that are nullable. By making these columns not null with default,
there would always be a value in the column, space for char/varchar,
and 0 for integer/smallint/decimal. Does this cause any problems with
the Java/Hibernate code? The DBA has indicated that all of the other
Java applications are defined this way.
=== END MAIL ===

Thanks,
John.


Reply With Quote
  #2  
Old   
greg.fenton
 
Posts: n/a

Default Re: Defaulting ALL database columns in ALL tables - not allowing any NULL values...??? - 01-23-2007 , 10:31 AM






DaFrizzler wrote:
Quote:
Hi, I have received the following email from a colleague, and am quite
frankly baffled by the idea.

I am just wondering if anyone has any advice or suggestions about
this????

NULL is NULL. If your application uses NULL (or, better said, doesn't
specify values), then NULL is what should be used.

NULLable columns aren't a performance problem if your data has NULLs.
In fact, they are a performance *improvement*. Where NULLable columns
are a performance hit is when the data is (almost) never NULL.

Pulling a column value out of the database and checking it to see if it
is some magic value ('' or 0 or -1 or 'NULL' or whatever) is
substantially worse than checking the NULL flag. It is a fallacy that
nullable columns are a performance hit; it is only a (minor)
performance hit when the NULL flag is always the same value (if always
FALSE then the check is a waste; if always TRUE then the column is a
waste).



Reply With Quote
  #3  
Old   
Ed Prochak
 
Posts: n/a

Default Re: Defaulting ALL database columns in ALL tables - not allowing any NULL values...??? - 01-23-2007 , 10:52 AM




DaFrizzler wrote:
Quote:
Hi, I have received the following email from a colleague, and am quite
frankly baffled by the idea.

I am just wondering if anyone has any advice or suggestions about
this????

=== BEGIN MAIL ===
The DB2 DBA has requested that all columns in the tables be defined as
not null with default to improve storage, performance, and ease of
backup/recovery. Currently there are several columns in each table
that are nullable. By making these columns not null with default,
there would always be a value in the column, space for char/varchar,
and 0 for integer/smallint/decimal. Does this cause any problems with
the Java/Hibernate code? The DBA has indicated that all of the other
Java applications are defined this way.
=== END MAIL ===

Thanks,
John.
I agree with greg. what is that DBA smoking? NULL is not a performance
or storage issue in DB2. And if it affects his backup/recovery, that
DBA needs to be replaced. This thinking sounds like an old mainframe
flat file programmer talking.


OH! I see what the real purpose is in the last sentence: "all the
other..."
That DBA is not thinking, he is just doing monkey see monkey do. Tell
him to document the reasons, including pointing to IBM manuals or
bulletins that support this view. I'm sure the request will quickly
fade away. (I'll not be surprised to hear the DBA is a new hire or
recent promotion.

Ed



Reply With Quote
  #4  
Old   
Lemming
 
Posts: n/a

Default Re: Defaulting ALL database columns in ALL tables - not allowing any NULL values...??? - 01-24-2007 , 07:43 PM



On 23 Jan 2007 08:52:21 -0800, "Ed Prochak" <edprochak (AT) gmail (DOT) com>
wrote:

Quote:
I'll not be surprised to hear the DBA is a new hire or
recent promotion.
Harsh.

But fair.

Lemming
--
Curiosity *may* have killed Schrodinger's cat.


Reply With Quote
  #5  
Old   
Lew
 
Posts: n/a

Default Re: Defaulting ALL database columns in ALL tables - not allowingany NULL values...??? - 01-24-2007 , 10:13 PM



Ed Prochak wrote:
Quote:
I'll not be surprised to hear the DBA is a new hire or
recent promotion.
Lemming wrote:
Quote:
Harsh.

But fair.
One hopes this DBA is an imminent terminee.

- Lew


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.