If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > Header and Detail Tables

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 12-05-06, 09:31
MMLL MMLL is offline
Registered User
 
Join Date: Dec 2006
Posts: 1
Header and Detail Tables

I am running a very old db2 database on an IBM iSeries system and am looking to redesign the entire applications in Java and the database in the latest DB2 version.

The current DB is divided into tons of header and detail tables. I have seen recent publications where it seems that the practice now is NOT to split you data into header or details tables.

I just want to do a sanity check to see if that is actually the bet way to go on a new design. Any feedback appreciated.

Thanks
Reply With Quote
  #2 (permalink)  
Old 12-05-06, 10:13
ARWinner ARWinner is offline
Registered User
 
Join Date: Jan 2003
Posts: 3,575
Personally, I prefer to use header and detail tables. I have not seen these recent publications, so I do not know their justification for denormalization. To me, normalization just makes sense. It will take up less space. It can be faster, especially when you just need the data in the header table. It also help prevent data corruption when "header" data on denormalized tables is changed on one row but not others. Then there is when you have to change "header" data, you then have to change it on all rows in the denormalized table instead of just one row in a normalized header table.

HTH

Andy
Reply With Quote
  #3 (permalink)  
Old 12-05-06, 14:30
Marcus_A Marcus_A is offline
Registered User
 
Join Date: May 2003
Location: USA
Posts: 5,196
Quote:
Originally Posted by MMLL
I am running a very old db2 database on an IBM iSeries system and am looking to redesign the entire applications in Java and the database in the latest DB2 version.

The current DB is divided into tons of header and detail tables. I have seen recent publications where it seems that the practice now is NOT to split you data into header or details tables.

I just want to do a sanity check to see if that is actually the bet way to go on a new design. Any feedback appreciated.

Thanks
You need to give an example of what you mean.
__________________
M. A. Feldman
IBM Certified DBA on DB2 for Linux, UNIX, and Windows
IBM Certified DBA on DB2 for z/OS and OS/390
Reply With Quote
  #4 (permalink)  
Old 12-06-06, 03:19
Wim Wim is offline
Registered User
 
Join Date: Nov 2004
Posts: 1,279
What do you mean by "header and detail tables" I am not familiar with these terms in the context of database design.

They are used in User Interface context: like header is a 'person', and detail contains zero, one or more of his 'known addresses', past or present.

In a database environment this header-detail concept is one a one-to-one basis translated in two tables: one for the PERSON and one for the ADDRESS. An address in the ADDRESS table will contain a refecence to the record of person 'John' in the PERSON table. This is called a parent-child relationship: the child record (ADDRESS) has a references to the parent record (PERSON).

Is this what you meant ? If it is, leave it as it is. You will get yourself into mayor trouble if you would change it. It is called "normalisation". I guess you know what it is, but if you don't, read a book or take a course about database design, it is not complicated, but it is a basic skill you need to have if you want to do anything serious on a database.

What you may have read is that in data warehouses, for ease of use and reasons of speed, all this information is denormalised into one big table. It is usefull if you want to make reports, based on this, but it is not meant to be used to add/alter/delete data like in a production environment.
__________________
With kind regards . . . . . SQL Server 2000/2005/2008/2008 R2 Earned beers: 16
Wim
Beware of bugs in the above code; I have only proved it correct, not tried it. -- Donald Knuth
Grabel's Law: 2 is not equal to 3 -- not even for very large values of 2.
Pat Phelan's Law: 2 very definitely CAN equal 3 -- in at least two programming languages
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On