Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

What is Best Use for Primary Key?

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
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    Post subject: What is Best Use for Primary Key?
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

Site Director


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

PostPosted: Fri Jun 01, 2007 12:08 am    Post subject:
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    Post subject:
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    Post subject:
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

Site Director


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

PostPosted: Fri Jun 01, 2007 7:08 pm    Post subject:
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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> DB2 All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts SFTP to primary and secondary servers mallik4u JCL & VSAM 4 Tue Jun 07, 2016 12:52 pm
No new posts Count unique values in a column based... Deepakgoyal2005 JCL & VSAM 4 Fri Jul 25, 2014 5:49 pm
No new posts Skipping secondary record when primar... magesh23586 DFSORT/ICETOOL 8 Sat Dec 07, 2013 11:41 pm
No new posts XRC side effect On Primary site. Manshadi JCL & VSAM 2 Wed Feb 27, 2013 5:31 pm
No new posts how to know primary key in a table? NAARAAYANAN JCL & VSAM 4 Wed Sep 26, 2012 4:18 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us