|
|
| Author |
Message |
ramfrom84
Active User
Joined: 23 Aug 2006 Posts: 87 Location: chennai
|
|
|
|
Hi All,
In my table contains Six primary key.
I have value for three primary key.
What would be better Choice 1 or 2 , (consider the performance also)
1. Select query with three key value
2. Select query with any one key value |
|
| Back to top |
|
 |
References
|
Posted: Thu May 31, 2007 8:34 pm Post subject: Re: What is Best Use for Primary Key? |
 |
|
|
 |
dick scherrer
Global Moderator
Joined: 23 Nov 2006 Posts: 7505 Location: 221 B Baker St
|
|
|
|
Hello,
Your request is quite unclear.
Please post the parts of the table definition that are involved with your question as well as sample queries that you are asking about. |
|
| Back to top |
|
 |
ramfrom84
Active User
Joined: 23 Aug 2006 Posts: 87 Location: chennai
|
|
|
|
Hi All,
Imagine the table with six primary key as general...
The table contains Six primary key. I have value for three primary key.
What would be better Choice 1 or 2 , (consider the performance also)
1. Select query with three primary key value
2. Select query with any one key value |
|
| Back to top |
|
 |
Naresh Kumar Reddy P
New User
Joined: 24 May 2007 Posts: 9 Location: Bangalore
|
|
|
|
Still your explanation is not clear. Can please give us an example?
| Quote: |
| Imagine the table with six primary key as general... |
By this do u mean primary key is the combination of six fields?
If it is the case, selecting the table based on the full primary key will always be the right choice on performance basis. The less u give the values for primary key, the lesser in the performance as well.
Thanks
Reddy |
|
| Back to top |
|
 |
dick scherrer
Global Moderator
Joined: 23 Nov 2006 Posts: 7505 Location: 221 B Baker St
|
|
|
|
Hello,
Please provide the requested information.
Re-posting the original unclear request will get few useful replies.
We can provide suggestions, but you have to present something more solid to work with. |
|
| Back to top |
|
 |
munikumar
New User
Joined: 18 Apr 2007 Posts: 31 Location: India
|
|
|
|
As per my knowledge, if your table is vast in size then better to select with three primary key values.
But there is one problem, the number of index scans will be more, this leads to performance degradation. |
|
| Back to top |
|
 |
|
|