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
 

 

Advantage of IMS secondary Index

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> IMS DB/DC
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    Post subject: Advantage of IMS secondary Index
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

Senior Member


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

PostPosted: Thu Oct 16, 2008 11:02 am    Post subject:
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

Senior Member


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

PostPosted: Thu Oct 16, 2008 11:06 am    Post subject:
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

http://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    Post subject: Reply to: Advantage of IMS secondary Index
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10211
Location: italy

PostPosted: Thu Oct 16, 2008 3:24 pm    Post subject: Reply to: Advantage of IMS secondary Index
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    IBMMAINFRAMES.com Support Forums -> IMS DB/DC All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Order BY AND Index Nileshkul DB2 2 Sat Dec 31, 2016 6:33 pm
No new posts Several errors during building altern... Andi1982 JCL & VSAM 11 Wed Jul 06, 2016 7:39 pm
No new posts Drop building Alternate Index for a p... bhavin.mehta JCL & VSAM 6 Mon Jul 04, 2016 3:47 pm
No new posts SFTP to primary and secondary servers mallik4u JCL & VSAM 4 Tue Jun 07, 2016 12:52 pm
No new posts VSAM Alternate Index in CICS jacobdng CICS 2 Fri May 06, 2016 1:41 pm


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