× 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.



"RPG400-L" <rpg400-l-bounces@xxxxxxxxxxxx> wrote on 04/22/2017 01:00:02
PM:
----- Message from Vinay Gavankar <vinaygav@xxxxxxxxx> on Fri, 21
Apr 2017 17:42:56 -0400 -----

To:

"RPG programming on the IBM i (AS/400 and iSeries)"
<rpg400-l@xxxxxxxxxxxx>

Subject:

Accessing Database vs Dataarea

Hi,

We have a program where same record of a 'control' file (input mode) is
being read for every iteration, and I thought that replacing the 'Chain'
with reading a dataarea.

So I ran a simple test to compare the time taken to read one record in
file
100,000 times and reading a data area 100,000 times with 'IN' statement.

I was surprised that the file was read under 1 sec, whereas dataarea
took
around 4-5 seconds.

Just to make sure, I looped for a million times. The file came in at 4
seconds and dataarea at 47 seconds.

I was wondering whether I am missing something or accessing a dataarea
with
an 'IN' statement takes that long compared to file read.


Just to be clear, does the IN operation specify *LOCK? If so, that would
explain part of it.

I would love to hear from someone with some knowledge about the internal
implementation of IN. i.e., Is the data area object and associated
pointers resolved each time?

Odd results indeed.

Michael Quigley
Computer Services
The Way International
www.TheWay.org

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

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.