IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

What is Best Use for Primary Key?


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
ramfrom84

New User


Joined: 23 Aug 2006
Posts: 93
Location: chennai

PostPosted: Thu May 31, 2007 8:34 pm
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Fri Jun 01, 2007 12:08 am
Reply with quote

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
View user's profile Send private message
ramfrom84

New User


Joined: 23 Aug 2006
Posts: 93
Location: chennai

PostPosted: Fri Jun 01, 2007 11:13 am
Reply with quote

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
View user's profile Send private message
Naresh Kumar Reddy P

New User


Joined: 24 May 2007
Posts: 8
Location: Bangalore

PostPosted: Fri Jun 01, 2007 1:06 pm
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Fri Jun 01, 2007 7:08 pm
Reply with quote

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
View user's profile Send private message
munikumar
Currently Banned

New User


Joined: 18 Apr 2007
Posts: 24
Location: India

PostPosted: Thu Jun 07, 2007 11:45 am
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts Query on edit primary command CLIST & REXX 5
No new posts Query on edit primary command CLIST & REXX 1
No new posts Cobol prog to put an indicator on the... JCL & VSAM 1
No new posts Can we Insert duplicates in Primary U... DB2 2
No new posts SFTP to primary and secondary servers JCL & VSAM 4
Search our Forums:

Back to Top