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



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
deleted.
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
be used.

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:
Select *
from Table(MTI_INFO('YOURSCHEMA'));

Check where the MTIs are used ... and generated permanent indexes for the
MTIs which are regularly/heavily used.


Mit freundlichen Grüßen / Best regards

Birgitta Hauser
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
Brown)
"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)

-----Original Message-----
From: MIDRANGE-L <midrange-l-bounces@xxxxxxxxxxxxxxxxxx> On Behalf Of Gerald
Magnuson
Sent: Monday, 6 March 2023 17:01
To: midrange-l@xxxxxxxxxxxxxxxxxx
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
look?
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
morning run.
--
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,
visit: https://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives at
https://archive.midrange.com/midrange-l.

Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription related
questions.



As an Amazon Associate we earn from qualifying purchases.

This thread ...

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.