Home » Developer & Programmer » Designer » Defing Primary key
Defing Primary key [message #90475] Tue, 11 November 2003 04:04 Go to next message
Pradeep
Messages: 55
Registered: July 2000
Member
Is it better to have 3 composite key to be the PK in a table or add one more colum field which is a PK.
like a sequence no.

My all 3 composite key are Foreign keys of different table
Re: Defing Primary key [message #90476 is a reply to message #90475] Tue, 11 November 2003 05:29 Go to previous message
Daljit Singh
Messages: 290
Registered: October 2003
Location: Texas
Senior Member
Hi,

Well this question is totally based on the queries which u r abt to fire against ur DB. if ur three keys alway appear in the where clause with proper seq then composite PK will work properly, but if u use only some or one of the column in where clause then u have to define diff PK to use indexes.

Remember that in composite PK the first column appear in ur PK must be there in ur where clause to use indexes.
Previous Topic: want to modify multiple empty tables
Next Topic: Why a transaction can be larger than online log?
Goto Forum:
  


Current Time: Thu Nov 21 13:41:58 CST 2024