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

Advantage of IMS secondary Index


IBM Mainframe Forums -> IMS DB/DC
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
shyam k dhanraj

New User


Joined: 18 Jun 2008
Posts: 27
Location: bangalore

PostPosted: Thu Oct 16, 2008 10:49 am
Reply with quote

I know that secondary index is used when there is a requirement to select database records in a sequence other than that defined by the root key. What is the biggest advantage of doing this in terms of performance. Can any one please explain this with a small example?
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Thu Oct 16, 2008 11:02 am
Reply with quote

Hi,

In General, A secondary index provides additonal direct access to rows.

For example an "Merchant " table might have a primary key of "Merchant Number". Each merchant also has their current department code (Dept_code) in their Merchant table entry. If Dept_code was a secondary index, a query could directly retrieve all of the people in a specific department without traversing the entire table.
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Thu Oct 16, 2008 11:06 am
Reply with quote

Hello again,

By the way there is a sticky telling where to find information about IMS, following the first link in that sticky and searching for 'SECONDARY INDEX' leads to this, and there's a lot more to find

publib.boulder.ibm.com/infocenter/dzichelp/v2r2/index.jsp?topic=/com.ibm.ims9.doc.adb/xf6269.htm
Back to top
View user's profile Send private message
shyam k dhanraj

New User


Joined: 18 Jun 2008
Posts: 27
Location: bangalore

PostPosted: Thu Oct 16, 2008 11:13 am
Reply with quote

I have all the redbooks that I want. I have recently also built a secondary index and I am making use of it. I am using a HIDAM database. Secondary index in general gives me an option of direct access to rows. In a HIDAM database, how does a secondary index help me in terms of number of segment occurences accessed if I dont use secondary index and I dont use secondary index

Note: Deleted the duplicate post..Anuj
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10872
Location: italy

PostPosted: Thu Oct 16, 2008 3:24 pm
Reply with quote

as a general concept secondary/alternate indexing is just that
a different access path to &database &records

there is no advantage / disadvantage considerations
just access path considerations

if You have a &database with two fields

field1,field2

field1 primary key ( hence ordered )
field2 .......

if You want to access a &database &record where field2 has a specific value

You have two chances
read sequentially the &database until Your search is satisfied
.... use a secondary/alternate index
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 -> IMS DB/DC

 


Similar Topics
Topic Forum Replies
No new posts Execute secondary panel of sdsf with ... CLIST & REXX 1
No new posts Cobol file using index COBOL Programming 2
No new posts DL/I status code AK for GU call using... IMS DB/DC 1
No new posts Add column to existing records using ... JCL & VSAM 2
No new posts choice of clustering index DB2 3
Search our Forums:

Back to Top