Better for Surrogate Key Generation? Dstage or DB procedure

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
rggoud
Participant
Posts: 15
Joined: Thu Nov 06, 2003 9:59 am

Better for Surrogate Key Generation? Dstage or DB procedure

Post by rggoud »

Hi,

Currently I'm having the surrogate key generation logic in datastage. The jobs queries the max Surrogate Key from the database and increments for every new source dimension records. One of my collegue is debating that if we put the surrogate key generation logic into the database stored procedure so that the load jobs will get some increased performance . What is the best practice to generate surrogate key ? In Database or in Datastage. I somehow feel Datastage should be used to handle any data management and database be should for data access/storage. I need pros and cons for these both options. This topic might be discussed long back, but i'm unable to locate those easily. Thanks.

Raj.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Main considerations, it seems to me, are
  • whether other, non-DataStage, updates may be made to the table (in which case use the database rather that DataStage)

    whether the bulk loader (if you're using one) can make use of database-generated keys - if not, you need to generate them in DataStage
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply