Issue with order of primary keys

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
bharatagnihotri
Participant
Posts: 7
Joined: Thu Sep 30, 2004 5:22 am

Issue with order of primary keys

Post by bharatagnihotri »

DS - 7.5.1 (DB2 API and EE stages)

Is there any know issue with the sequence of primary keys for a DB2 table (DB2 API or EE stages) ?

i.e. say we have a table T1 with following structure:

Collumn Primary Key
C1 Y
C2 N
C3 N

A datastage job is created for this table structure. After this now the table structure is changed and a new collumn and key is added.

Collumn Primary Key
C1 Y
C2 N
C3 N
C4 Y

Here, is there any known issue with the primary key defined at the end of the table, instead of the start with other primary keys ?

Cheers,
BA
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

No, there's no rule as to where or in what order they need to be declared in the table. That's a people thing.
-craig

"You can never have too many knives" -- Logan Nine Fingers
bharatagnihotri
Participant
Posts: 7
Joined: Thu Sep 30, 2004 5:22 am

Thanks

Post by bharatagnihotri »

[quote="chulett"]No, there's no rule as to where or in what order they need to be declared in the table. That's a people thing. ...[/quote]

Thanks for your reply, just one more thing, will it impact the job (if we don't add this key) in any way i.e. will it require job change or anything of that sort ? I think the issue is seen with the hash file i.e. the keys have to be in same order and all of them shud be there, but was not sure if this holds for the EE stage as well..
kduke
Charter Member
Charter Member
Posts: 5227
Joined: Thu May 29, 2003 9:47 am
Location: Dallas, TX
Contact:

Post by kduke »

It does make a difference in a hashed file. Otheriwse Craig is correct. In a SQL statement it makes no difference.
Mamu Kim
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Right, in a RDBMS table it makes absolutely no difference where indexed fields are in the table, including the PK fields. As noted, the only thing that seems to care is the wetware, the people.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply