It seems it generates one or multiple temporary indexes (MTI). Creating a
temporary index will take the same time as generating a permanent index.
A MTI is quasi permanent, i.e. it stays available until the last access plan
where the MTI is used disappears from the plan cache.
When executing an IPL the SQE Plan Cache gets cleared an all MTIs get
When running the query the optimizer seems not to find an appropriate index
and creates one (which takes time).
You ended your query but you did not interrupt the creation of the temporary
index ... so when you run the query again, the index was completed and could
You should check what MTIs are available and also check where they are used
and how often they are used.
Since the last TR there is a UDTF MTI_INFO to detect MTIs:
The following Query returns all MTIs generated in your schema:
Check where the MTIs are used ... and generated permanent indexes for the
MTIs which are regularly/heavily used.
Mit freundlichen Grüßen / Best regards
Modernization ? Education ? Consulting on IBM i
IBM Champion since 2020
"Shoot for the moon, even if you miss, you'll land among the stars." (Les
"If you think education is expensive, try ignorance." (Derek Bok)
"What is worse than training your staff and losing them? Not training them
and keeping them!"
?Train people well enough so they can leave, treat them well enough so they
don't want to.? (Richard Branson)
From: MIDRANGE-L <midrange-l-bounces@xxxxxxxxxxxxxxxxxx> On Behalf Of Gerald
Sent: Monday, 6 March 2023 17:01
Subject: daily job, lots of complex sql. completes in around 1 minute,
except first run AFTER month-end IPL.
when this job runs Monday morning after the monthly processing and IPL, we
end the job after 20 minutes, as it appears to be just barely progressing.
(job was running at 4am, but this month we moved it to 6am.) when we have
the developer look (at around 7am), he runs the job again, and it completes
in around 1 minute.
they are asking me to see about a missing index, but I don't know where to
we are moving the monday morning run to Sunday morning, just before we take
system down. but, I am thinking we just will move the problem to the Tuesday
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@xxxxxxxxxxxxxxxxxx To subscribe,
unsubscribe, or change list options,
or email: MIDRANGE-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives at
Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription related
As an Amazon Associate we earn from qualifying purchases.