can i reset a surrogate ky? 4 byte tracks 2 billion if more?

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
nraj
Participant
Posts: 15
Joined: Tue Feb 22, 2005 9:22 am

can i reset a surrogate ky? 4 byte tracks 2 billion if more?

Post by nraj »

a surrogate key is 4 byte int bu which we can track 2 billion records,

if records more than 2 billion what is the solution
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

If you choose a 64-bit integer in the Surrogate Key Stage you can track surrogate keys from 0 through 9223372036854775807 ((2^^64/2)-1). If you are using a 4-byte key ((2^^32/2)-1) you have 2147483647 positive numbers (double that if you also use negative ones).

I don't know what your actual question is. If you utilize a 4-byte integer in the database for the surrogate key you are limited as above and there is nothing you can do unless you either store less records or use another datatype or add an additional column in the table to make up a unique key.
Sainath.Srinivasan
Participant
Posts: 3337
Joined: Mon Jan 17, 2005 4:49 am
Location: United Kingdom

Post by Sainath.Srinivasan »

Go for a larger datatype such as Number(38). You hardly can miss anything by that.
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

Sainath - I can't find any way to make the Surrogate Key stage in Px use anything but integers. How do you specify NUMBER (and how can one really use a floating-point representation for a unique key without having to worry about duplicates)?
Baldmartyr
Participant
Posts: 108
Joined: Mon Oct 21, 2002 8:30 am

Post by Baldmartyr »

This topic does not belong in the FAQ Discussion forum. Should it be removed to the PX forum?
David Baldwin
Former DSXchange Webmaster
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

Yes, it needs to be moved forthwith - I didn't realize which forum we were in.
Post Reply