|
I think the APIs are in the SEPT nowadays so they should be pretty fast. Obviously there's a bit of overhead as IBM checks for errors in the parm list, and other things--things you would normally do if you used MI directly. So would MI be "faster" yes, but would it be appreciably fast, probably not. Yes adding multiples at once is much less overhead than adding them one at a time. As to the other comments people have made regarding sorting, I think if you exceed around 1000 entries, user indexes are always going to be faster than sorting and searching. Under 1000 entries, sorting and search is going to beat the index method proportionately as the number of entries approaches zero. -Bob Cozzi www.i5PodCast.com Ask your manager to watch i5 TV -----Original Message----- From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Steve Moland Sent: Thursday, March 15, 2007 9:43 AM To: rpg400-l@xxxxxxxxxxxx Subject: RE: Understanding User Indexes from RPG Hi Bob, Wow, you comment was amazingly spot on to something I've got to add to an application. I've used user indexes a number of times to replace run time tables which were used cut down on the time disk "chains" take. I've found the indexes to be much faster than using keyed disk files though I always thought of user indexes as just being the built-in access method that a "chain" in RPG would use. Anyway the largest user index I've used was about 60,000 17 byte entries (all 17 were the key). Existence in the index was all that mattered. I've a new need to use them but the number of entries will be from 700,000 to a few million, so I've been thinking of the index creation time. Shouldn't have to be done all that often but enough for me to be thinking performance. Currently I load the index 100 entries per API call which seemed to be much faster than an API call for every entry. For 60,000 entries the time seemed long. Will using MI be appreciably faster on the load portion. Will the retrieval be faster as well though using the API appears to instantaneous. DO you have any sample code for using MI stuff in RPG. Regards Steve Moland Access Paths Inc 12 Parmenter Rd Unit C4 Londonderry NH 03053 603 845-0190 Ext 2 steve@xxxxxxxxxxx
------------------------------ message: 9 date: Thu, 15 Mar 2007 08:26:53 -0500 from: "Bob Cozzi" <bob@xxxxxxxxxxxx> subject: RE: Understanding User Indexes from RPG
Recently I used RPG and the APIs but I moved to using the MI
instructions in RPG to access index entries.
The best place to read about these things is in the MI instructions for Independent Indexes. Some MI instructions are: CRTINX INSINXEN FNDINXEN
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.