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 > Surrogate keys necessary?

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 10-02-06, 00:50
trss trss is offline
Registered User
 
Join Date: Sep 2006
Posts: 20
Lightbulb Surrogate keys necessary?

Consider the foll. dependencies.
ABC->D and BCE->F

For the above dependencies, is it better to have a surrogate key (no practical use whatsoever), S and create the foll. tables:-
SBC, ASD and SEF
(Since ASBCD or ABCEF would have a dependency which prevents it from being in 2NF).
Or will DB2 automatically take care, i mean, will it have no effect on the efficiency of the DB if the foll. tables:-
ABCD and BCEF
are used instead?

The no. of tables created in case surrogate keys are used is also more. Besides that, how do we depict the surrogate key table in the ER diagram in case surrogate keys are used? If they are depicted in the normal way, they won't make any sense. So what do we do? Do we design the ER diagram in the non-optimized form (without surrogate keys)? I don't think that is acceptable.

Last edited by trss; 10-06-06 at 12:03.
Reply With Quote
  #2 (permalink)  
Old 10-02-06, 01:06
Marcus_A Marcus_A is offline
Registered User
 
Join Date: May 2003
Location: USA
Posts: 5,196
The use of surrogate keys instead of natural keys is debatable and highly contentious. Personally, I like natural keys if they don't have a lot of columns, but there are always exceptions.

Performance is “usually” not a big issue unless the surrogate keys get large.
__________________
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
  #3 (permalink)  
Old 10-02-06, 02:43
trss trss is offline
Registered User
 
Join Date: Sep 2006
Posts: 20
I request more details

Quote:
Originally Posted by Marcus_A
The use of surrogate keys instead of natural keys is debatable and highly contentious.
Do u mean use of surrogate keys instead of a combination of keys being used as a natural primary key as shown in the eg.?

Quote:
Originally Posted by Marcus_A
Performance is “usually” not a big issue unless the surrogate keys get large.
Can u expand on that please. I mean, it is not specific. What exactly does large mean?
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