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

Will Indexing the primary key improve the join performance


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

New User


Joined: 01 Apr 2005
Posts: 11

PostPosted: Thu Jan 18, 2007 7:54 pm
Reply with quote

A query joins some 5 tables. Two fields of a table are used in the where conditions .One is a primary key and the other is not indexed. We have planned to improve the performance of the query by indexing it.
My question comes here. Can it be indexed alone(it is not unique) or
togather with the primary key to create a unique index.
Which will be better.
Can someone help me.
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Thu Jan 18, 2007 8:21 pm
Reply with quote

It can be indexed alone as a non-unique index and it can be indexed together with a unique index if you wanted that.
Back to top
View user's profile Send private message
rajandhla

Active User


Joined: 18 Oct 2005
Posts: 182
Location: Luton UK

PostPosted: Fri Jan 19, 2007 10:46 am
Reply with quote

i will go with william suggestion
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 exploiting Z16 performance PL/I & Assembler 2
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 Join multiple records using splice DFSORT/ICETOOL 5
No new posts Join 2 files according to one key field. JCL & VSAM 3
Search our Forums:

Back to Top