|
After about 1,000 to 10,000 records, you're better off using a User Index for the best performance. There is not practical limit to the number of entries. -Bob -----Original Message----- From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Tony Carolla Sent: Tuesday, November 09, 2004 2:52 PM To: RPG programming on the AS400 / iSeries Subject: Memory Allocation Question I am working on a program that, for good reason, runs loooooong. I am looking through our account files to find matching accounts, where two of Name, DOB, SS# match. We frequently deal with the same client in the same day, but create a new account for them (hospital billing--long story). My task seemed easy at first, so I wrote it as follows: -Create one file with all accounts -Start with the first record, compare it to all others - Move to next record. This thing ran for hours and hours. Then I calcd it (3,500,000 accts) at somewhere over 12 trillion DB reads. We have a fast machine, but no. My current version uses a user space, and a data structure, based on a pointer, that moves through the 'records' in the user space to do the comparison. Also, we agreed to only search within each company. This brings the number down to 294 billion iterations. Not bad, and the user space is much faster. But it is still slow. Takes an entire day to run. Even though this will be run monthly, I am considering another strategy, using memory. I know that I can allocate memory, base a pointer on that memory, and do the same thing I was doing to the user space to actual memory. My question is, what is the limit, and is there one. What happens if I end up alloc'ing ~10Meg? Does this seem like a reasonable strategy? Will it be faster? -- "Enter any 11-digit prime number to continue..." -- This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list To post a message email: RPG400-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options, visit: http://lists.midrange.com/mailman/listinfo/rpg400-l or email: RPG400-L-request@xxxxxxxxxxxx Before posting, please take a moment to review the archives at http://archive.midrange.com/rpg400-l.
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.