Brian,

Are part number and color the first two fields in the logical? If not, that's 
likely why it's not using it. If they are, you may need to add additional 
fields to the where clause to force it to use it. For example, if you have a 
size field, you'd add size=size to your where clause.

Check the second level text. It will tell you why it choose that access path. 
I'd also suggest creating a logical file based on the access path suggestion 
and see what happens. If the access patch suggestion matches your existing 
logical, make sure there's no select/omit criteria and that the SRTSEQ value 
matches your job.

Matt

-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On 
Behalf Of Brian Piotrowski
Sent: Tuesday, July 19, 2005 10:48 AM
To: RPG programming on the AS400 / iSeries
Subject: RE: Program performance incease ideas

Hi Matt,

Thanks for the response.

Yes, I do run it in debug.  Here's the messages I see when I check the joblog:

**** Starting optimizer debug message for query .
Unable to retrieve query options file.           
Unable to retrieve query options file.           
All access paths were considered for file SST37. 
Additional access path reason codes were used.   
Access path of file SST37S5 was used by query.   
Access path suggestion for file SST37.           
Unable to retrieve query options file.           
**** Ending debug message for query .            

The strange thing I see in this log is that I have SST37T2 as my logical file, 
but it uses SST37S5 instead...

Brian.

-----Original Message-----
From: Haas, Matt [mailto:Matt.Haas@xxxxxxxxxxx] 
Sent: Tuesday, July 19, 2005 10:27 AM
To: RPG programming on the AS400 / iSeries
Subject: RE: Program performance incease ideas

Brian,

Have you run this program in debug? If so, your job log should show query 
optimizer messages (I'm assuming that the SQL is the slow part). If the query 
optimizer isn't using the logical you think it should, you may need to alter 
the where clause of your query to make it use it. Also, if your logical has 
select/omit criteria in it, the query optimizer will not use it.

Matt

-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On 
Behalf Of Brian Piotrowski
Sent: Tuesday, July 19, 2005 10:10 AM
To: RPG programming on the AS400 / iSeries
Subject: Program performance incease ideas

Hi All,

 

I have a portion of one of my programs that does this:

 

Read Myfile

Do while not eof(Myfile)

  Read Myfile

  SQLSum = Get the sum of a series of records where somepart = current part# 
and somecolour = current part colour

  NewSum = CurrentSum - SQLSum

  Update Myfile

  Read Myfile

EndDo

 

I find this process to be very time-consuming, as each SQL transaction takes 
about 2-7 seconds to complete.  I'm using a logical file to get the data that 
is keyed on the part number and colour as well as only selecting records that 
have a status of 3 or 5.

 

Any ideas on how I could speed this up?  The physical file which it is updating 
only has 1400 records in it, and it's been running now for the past ½ hour and 
has less than ½ the records processed.

 

Thanks,

 

Brian. 

 

-=-=-=-=-=-=-=-=-=-=-=-=-=-

Brian Piotrowski

Specialist - I.T.

Simcoe Parts Service, Inc.

Ph: 705-435-7814 x343

Fx: 705-435-6746

bpiotrowski@xxxxxxxxxxxxxxx

-=-=-=-=-=-=-=-=-=-=-=-=-=-

 


As an Amazon Associate we earn from qualifying purchases.

This thread ...


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.