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 > db2 tables

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 02-03-08, 07:09
oracle10gsingh oracle10gsingh is offline
Registered User
 
Join Date: Nov 2007
Posts: 72
db2 tables

Hi All !!

I am working in datawarehousing environment ..where we lot of fact tables base tables and dimension tables ...
Q1. which the best way to optimize the table i.e should there be any limit on number columns per table ?
Q2.Is it something like integer column must be ahead of varchar column ?
Q3.Should be the length of varchar columns should be same across the database or in a table say if i have 2 varchar columns they should have same length or they should be placed adjacent to each other ?
Q4.Any best practices specifically for fact, dimension tables ?

If somebody could forward me any document or a URL that would be really nice .
There are few DB2 Champs here i would request them to answer my questions ! !

Thanks & Regards
Reply With Quote
  #2 (permalink)  
Old 02-03-08, 08:55
Marcus_A Marcus_A is offline
Registered User
 
Join Date: May 2003
Location: USA
Posts: 5,196
Q2. Unless you are updating the rows, it makes no difference in the order of the columns (varchar vs integer). In DB2 for z/OS, you can decrease the amount of logging if you place varchar columns at the end of the row, but only in situations where you update the columns after an insert. This does not apply to DB2 for Linux, UNIX, Windows since it autmatically places varchar columns at the end of the row regardless of the order of the column in your create table.

Q3. It makes no difference.
__________________
M. A. Feldman
IBM Certified DBA on DB2 for Linux, UNIX, and Windows
IBM Certified DBA on DB2 for z/OS and OS/390

Last edited by Marcus_A; 02-03-08 at 09:00.
Reply With Quote
  #3 (permalink)  
Old 02-03-08, 23:19
oracle10gsingh oracle10gsingh is offline
Registered User
 
Join Date: Nov 2007
Posts: 72
Thanks Marcus for your reply !! but i havent got all the answer till yet ! !
Q1.how many columns should be there in base tables dimension table,summary tables ? for optimization purposes .how should be the keys and constraints should be placed ?

Q2.number of columns per table ?

Q3. please send me all best practices for db2 and datastage ? we don't have enough exposure to documents and if you champions dont reply where else should we ask from ...i posted the same question there on ibm website forum nobody bothered to reply ! this forum seems to be active ..request you kindly guide me ...

Thanks & Regards,
Reply With Quote
  #4 (permalink)  
Old 02-03-08, 23:53
Marcus_A Marcus_A is offline
Registered User
 
Join Date: May 2003
Location: USA
Posts: 5,196
There is no way to answer that without knowing your business and your application. The size of the fact table depends on how many facts you have.

Sorry, but there are no easy answers or best practices that will tell you the answers you want. If there were easy answers, then most of the databases in the world would be well-designed, which is not the case in my experience.
__________________
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
  #5 (permalink)  
Old 02-04-08, 00:29
nidm nidm is offline
Registered User
 
Join Date: May 2003
Posts: 113
Q2.number of columns per table ?
750 or fewer (including hidden columns), 749 if the table is a dependent


Agree with Marcus_A. Those DBA or Database consultants receive pretty high and stable pay for a good reason.
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