× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



I have written many data warehouse routines, that churn through record
counts in the hundreds of millions.  And because speed has been the
principal goal (other than accuracy), I have conducted many tests using READ
vs. READE.  I have found that the real difference between the two is that
READE is doing a LOOKUP each time it runs, while READ is obviously only
grabbing the next record.  If you use READE and specify BLOCK(*NO), versus
using READ and specifying BLOCK(*YES), and overriding the block size to an
I/O block of 128k, the differences are very real.  In smaller cases (reading
a few hundred to a few thousand records), the differences are smaller.

One of the key things to watch out for though, is if you use READE, and
specify BLOCK(*YES), as Scott suggested for the test.  In this case, you are
doing a DB LOOKUP, reading a block-size buffer of records, and tossing the
entire block out at the start of each READE operation -- now that is the
worst case, and will result in staggering performance differences.

So I don't believe I have ever 'bashed' READE, it is good for certain
operations, and for smaller volumes.  You just have to consider what the
goal of the program is.  I have gone so far as to study the file being read,
and figure out what the average/max/min records per account is, and set the
block size accordingly, to read all of account's records in one READ.

Bottom line -- If you are asking about performance, you are going to get
advice from people like me that are willing to go the extra mile for those
few seconds/minutes.

On 12/14/05, Rich Duzenbury <rduz-midrange@xxxxxxxxxxxxxxxxxxx> wrote:
>
> On Wed, 2005-12-14 at 16:49 -0500, rob@xxxxxxxxx wrote:
> > "In my opinion, there should be..."
>
> What I've seen is many folks bash READE, and recommend replacing it with
> a READ + test, with only anecdotal evidence to back up the claim that it
> runs faster.  I've at least bothered to write test code that shows that
> in this one circumstance, they operate in very close to the same amount
> of time.
>
> Since I have no access to the source code for OS/400, I can only do my
> best to devise a fair test program, run it, and interpret the results.
> I also try to use my experience as a developer to hypothesize about how
> another programmer might write the function(s) in question.
>
> Regards,
> Rich
>
>
> --
> 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.
>
>


--
"Enter any 11-digit prime number to continue..."
"In Hebrew SQL, how do you use right() and left()?..." - Random Thought
"If all you have is a hammer, all your problems begin to look like nails"

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

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.