|
ECHCONO = :H and ECDCONO = :H may be redundant, however, I don't have--
indexes by ECOVND and ECDEXT. So in order to take advantage of the ECDCONO,
ECOVND, ECDEXT index, I need to select on all three fields.
-----Original Message-----
From: midrange-l-bounces@xxxxxxxxxxxx [mailto:
midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of Luis Rodriguez
Sent: Tuesday, December 21, 2010 2:21 PM
To: Midrange Systems Technical Discussion
Subject: Re: Processing Unit Time
Michael,
(Just curious) In your statement:
SELECT SUM ( CASE : H WHEN 'DR' THEN ECDEAM ELSE ECDQTY END )
INTO : H
FROM IMSPRECH
JOIN IMSPRECD
ON ECDCONO = ECHCONO
AND ECDSTR = ECHSTR
AND ECDRCT = ECHRCT
WHERE ECHCONO = : H
AND ECHDTE BETWEEN : H AND : H
AND ECDCONO = : H
AND ECOVND = : H
AND ECDEXT = : H
Am I right in supposing that ECHCONO, ECHSTR and ECHRCT belong to
IMSPRECH?
Most of the time I see the join fields in the same order as the tables are
expressed, e.g. ECHCONO = ECDCONO (just a personal question of style, I
realize, nevertheless, curious all the same :-) ).
Also, IIRC, the WHERE clause works AFTER the tables have been joined, so
what happens if you change your first join clause to ECHCONO = : H , which
would limit the size of your JOIN file and drop the ECHCONO = : H
andECDCONO = : H clauses
(which, if I'm not mistaken, are redundant anyway, as they are part of the
JOIN clause). Run that again thru VE and see if it suggest a different
index.
Regards,
Luis Rodriguez
IBM Certified Systems Expert - eServer i5 iSeries
--
On Tue, Dec 21, 2010 at 1:20 PM, Schutte, Michael D <
Michael_Schutte@xxxxxxxxxxxx> wrote:
Yes I have thought about it. Unfortunately that requires time to redothe
program. I even suggested to my boss, but he's leaning toward moving toa
different job queue. I'm just not understanding the 1448 seconds of CPUit
time. What isn't being accounted for in this measurement? I know that
says nine seconds. But really doesn't. If you run interactively, it'slike
12ms. Anyway, thanks for the input. When I have time, I'll redesign bya
summarizing the table first and querying the summary table.
-----Original Message-----
From: midrange-l-bounces@xxxxxxxxxxxx [mailto:
midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of Morgan, Paul
Sent: Tuesday, December 21, 2010 11:50 AM
To: Midrange Systems Technical Discussion
Subject: RE: Processing Unit Time
Mike,
240,000 runs times the estimated query run time of 9 seconds is 2,160,000
seconds = 600 hours. Not bad that it finished in 11 hours.
Have you thought about modifying the query so it's only executed once to
work table for all retail items (maybe linking to another table with thetimes
retail items) and summarizing for each month of the past twelve months?
Then you run through the work table to make your calls to
updHTMLvar/WrtSection.
Paul Morgan
Principal Programmer Analyst
IS Supply Chain/Replenishment
-----Original Message-----
From: midrange-l-bounces@xxxxxxxxxxxx [mailto:
midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of Schutte, Michael D
Sent: Tuesday, December 21, 2010 11:15 AM
To: Midrange Systems Technical Discussion
Subject: RE: Processing Unit Time
No the access plan isn't getting updated on each call. It was last saved
at 10:28:05 That's when the program started, it finished at 21:34. I
suppose I cannot count. It only took 11 hours not 12. Haha. I believe
yesterday this sql statement was executed for every active retail item
(20,000 items) and for the past 12 months. So 20,000 * 12 = 240,000
the statement ran. After every call to sql statement, I'm executingoverall.
updHTMLvar and WrtSection. I know that this would slow the process
intended
Thinking back, this was probably poor design, but it wasn't really
to run for all items and all vendors, even though the prompt programallows
the user to do so. But still, I can live with CPU time of 1448 seconds,the
cannot live with 11 hours of actual run time. This is what I don't
understand.
-----Original Message-----
From: midrange-l-bounces@xxxxxxxxxxxx [mailto:
midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of Morgan, Paul
Sent: Tuesday, December 21, 2010 10:31 AM
To: Midrange Systems Technical Discussion
Subject: RE: Processing Unit Time
Michael,
How many times does this get run in the process? You're talking about
repeated calls to CGIDEV2 so does this get run once for each call? Is
access plan getting updated on each call?join
Paul
Principal Programmer Analyst
IS Supply Chain/Replenishment
-----Original Message-----
From: midrange-l-bounces@xxxxxxxxxxxx [mailto:
midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of Schutte, Michael D
Sent: Tuesday, December 21, 2010 10:10 AM
To: Midrange Systems Technical Discussion
Subject: RE: Processing Unit Time
This is from the PRTSLQINF command.
SELECT SUM ( CASE : H WHEN 'DR' THEN ECDEAM ELSE ECDQTY END )
INTO : H
FROM IMSPRECH
JOIN IMSPRECD
ON ECDCONO = ECHCONO
AND ECDSTR = ECHSTR
AND ECDRCT = ECHRCT
WHERE ECHCONO = : H
AND ECHDTE BETWEEN : H AND : H
AND ECDCONO = : H
AND ECOVND = : H
AND ECDEXT = : H
SQL4021 Access plan last saved on 12/20/10 at 10:28:05.
SQL4020 Estimated query run time is 9 seconds.
SQL4017 Host variables implemented as reusable ODP.
SQL4007 Query implementation for join position 1 table 2.
SQL4006 All indexes considered for table 2.
SQL4008 Index IMSLRECD9 used for table 2.
SQL4011 Index scan-key row positioning used on table 2.
SQL4007 Query implementation for join position 2 table 1.
SQL4006 All indexes considered for table 1.
SQL4008 Index IMSLRECH1 used for table 1.
SQL4014 1 join column pair(s) are used for this join position.
SQL4015 From-column 2.ECDCONO, to-column 1.ECHCONO, join operator MF,
join predicate 1.
SQL4015 From-column 2.ECDSTR, to-column 1.ECHSTR, join operator MF,
predicate 2.join
SQL4015 From-column 2.ECDRCT, to-column 1.ECHRCT, join operator MF,
predicate 3.jobs
SQL4011 Index scan-key row positioning used on table 1.
If it was doing a table scan, the print out above would show it and
wouldn't the CPU time be a lot greater. FYI, we didn't have any other
running on the system with higher priority. CPU% was around 70%. I don'tstatement
know. I'm starting to believe that it had nothing to do with the
itself but rather the repeated calls to WrtSection of the Dev2procedures.
SQL
-----Original Message-----
From: midrange-l-bounces@xxxxxxxxxxxx [mailto:
midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of Morgan, Paul
Sent: Tuesday, December 21, 2010 9:37 AM
To: Midrange Systems Technical Discussion
Subject: RE: Processing Unit Time
Michael,
Try running the process under debug (STRDBG/ENDDBG). That will get the
access plan printed in the job log. You can then review the access planto
see if it's actually using the logicals. Sometimes SQL will reject athe
logical for a sequential access if the previous run was very fast. It
thinks a sequential read through the file will be faster than including
overhead of an indexed read.that
Paul Morgan
Principal Programmer Analyst
IS Supply Chain/Replenishment
-----Original Message-----
From: midrange-l-bounces@xxxxxxxxxxxx [mailto:
midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of Schutte, Michael D
Sent: Tuesday, December 21, 2010 8:37 AM
To: Midrange Systems Technical Discussion
Subject: Processing Unit Time
I'm having trouble finding an explanation of this but I was wondering if
someone could explain this here. A user submitted a job the other day
took 6 hours to complete. By looking at the SQL statement in theprogram, I
saw where an improvement could be made. I created a new logical by theSo
selection keys in the where clause, so now the statement take less than a
second to run for a month of data and the entire company. The user
resubmitted the job yesterday and this time it took 12 hours to complete
while using the new logical. If you look at the job log it says that it
only used 1448 seconds processing unit time. That's only 24 minutes.
why did it take 12 hours. Is it because it created a 23,000 page joblog?
can
There are two messages that are repeated over and over again that I can
fix. Dataarea CGIDEBUG not found and null indicator require. The reason
for the CGIDEBUG message is because I'm using the CGIDEV2 procedures to
build an HTML page and then use write to stream file function so that I
email it to the user. Then for the null indicator, the sql statement isexecuting
summing a field but I'm not checking any statuses nor using a null
indicator. I've always just set the INTO field to zero prior to
the statement. I should change my habit to always use a null indicatorso
that this message isn't created in the job log. But I don't see why thisfor
would cause the program to run for 12 hours.
Any thoughts?
Bob Evans makes the holidays easier. Our Farmhouse Feast is a complete
holiday meal to go, ready to heat at home, serve and enjoy. Serves 6-8
just $74.99. Pre-order through your local Bob Evans or online atlist
www.bobevans.com/onlineordering<http://www.bobevans.com/onlineordering>
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing
To post a message email: MIDRANGE-L@xxxxxxxxxxxxlist
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing
To post a message email: MIDRANGE-L@xxxxxxxxxxxxlist
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing
To post a message email: MIDRANGE-L@xxxxxxxxxxxxlist
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing
To post a message email: MIDRANGE-L@xxxxxxxxxxxxlist
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing
To post a message email: MIDRANGE-L@xxxxxxxxxxxxlist
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing
To post a message email: MIDRANGE-L@xxxxxxxxxxxxlist
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing
To post a message email: MIDRANGE-L@xxxxxxxxxxxx--
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-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.