MTI (Maintained Temporary Indexes) are system generated temporary indexes, that exist as long as there is any access plan stored in the SQE Plan Cache.
... the MTI will disappear in either way if you run IPL.
After IPL, the next time these Indexes are needed they will generated again which is time consuming (takes as much time as generating permanent indexes).

If you generate (permanent) indexes for the MTIs they will stay available and not disappear (unless they get deleted).

Also you should check if there are indexes built over the join fields and where conditions with =

Mit freundlichen Grüßen / Best regards

Birgitta Hauser


"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 Richard Reeve
Sent: Mittwoch, 13. Oktober 2021 14:44
To: Midrange Systems Technical Discussion <midrange-l@xxxxxxxxxxxxxxxxxx>
Subject: Re: SQL optimization

This is my first shot at visual explain. It shows the creation of 4 temporary indexes. Does that indicate that I should create those 4 indexes?
All the best,

Richard Reeve


On Wed, Oct 13, 2021 at 7:38 AM Jim Oberholtzer <midrangel@xxxxxxxxxxxxxxxxx>
wrote:

What has the optimizer suggested? Have you put this into visual explain
to see how the optimizer is actually running the statement?

Jim Oberholtzer
Agile Technology Architects



On Oct 13, 2021, at 7:11 AM, Richard Reeve <rjrjr64@xxxxxxxxx> wrote:

All,

I have this SQL statement that runs quite slow. Any idea how I
might speed this up?

SELECT

WHS.DBWHS_SHIPMENT_NBR
,WHS.DBWHS_DOC_NBR
,COR.DBCOR_ORDER_NBR
,COR.DBCOR_ORDER_TYPE
,WHL.DBWHL_DESCRIPTION
---,' ' AS sggroup
---,' ' AS sold_to-pt
,COR.DBCOR_CUST_PO_NBR
---, ' ' as fol-doc
,WHS.DBWHS_BOL_NBR
,WHS.DBWHS_WEIGHT
,WHS.DBWHS_CARTONS
,WHS.DBWHS_SHIP_DATE
,WHS.DBWHS_TRANS_ID
---,' ' as proc-id
,WHS.DBWHS_METHOD
,SHP.DBSHP_CUSTOMER
,SHP.DBSHP_NAME
,SHP.DBSHP_NAME
,SHP.DBSHP_ADDR1
,SHP.DBSHP_ADDR2
,SHP.DBSHP_CITY
,SHP.DBSHP_STATE
,SHP.DBSHP_ZIP
---,DBBLSHP.''COST CENTER
,SPC.DBSPC_COMMENT
---,'' as whn
,WDH.DBWDH_DESTINATION
,WDH.DBWDH_DEST_NAME
,SHP.DBSHP_TAX_CODE ---,' ' as tax_juris ,WDH.DBWDH_DEST_STATE
,WDH.DBWDH_DEST_CNTRY ,WDH.DBWDH_DEST_ZIP ,WHS.DBWHS_CARRIER
,VEN.DBVEN_VENDOR_VNAME---,'v' as carrier name
,WHS.DBWHS_FREIGHT_CODE---', as incoterm code ---,' ' as incoterm
description ,WHS.DBWHS_FRT_CHG_CURR ,ARH.DBARH_TRAN_AMT ---,' ' as
acct ,ACM.DBACM_CREDIT_LIM ---,' ' as pint ,WHS.DBWHS_COMPANY
,COR.DBCOR_ORDER_DATE ---,WDM.DBWDM_UPDATE_DATE ,WHS.DBWHS_STATUS
,WHS.DBWHS_SHIP_DATE ---,'LAW' as ERP-IDENTIFIER

FROM LAWDBF7B.DBWHWHS WHS

LEFT JOIN LAWDBF7B.DBWHWHL WHL ON
WHS.DBWHS_DOC_NBR=WHL.DBWHL_DOC_NBR
LEFT JOIN LAWDBF7B.DBWHWDH WDH ON
WHS.DBWHS_DOC_NBR=WDH.DBWDH_DOC_NBR
LEFT JOIN LAWDBF7B.DBBLSHP SHP ON
WHS.DBWHS_CUST_SHIP_TO=SHP.DBSHP_SHIP_TO
LEFT JOIN LAWDBF7B.DBAPVEN VEN ON WHS.DBWHS_VENDOR=VEN.DBVEN_VENDOR
LEFT JOIN LAWDBF7B.DBBLSPC SPC ON
SHP.DBSHP_CUSTOMER=SPC.DBSPC_CUSTOMER
LEFT JOIN LAWDBF7B.DBARARH ARH ON
ARH.DBARH_CUSTOMER=SHP.DBSHP_CUSTOMER
LEFT JOIN LAWDBF7B.DBARACM ACM ON
ACM.DBACM_CUSTOMER=SHP.DBSHP_CUSTOMER
LEFT JOIN LAWDBF7B.DBBLCOR COR ON
COR.DBCOR_CUSTOMER=SHP.DBSHP_CUSTOMER

WHERE WHS.DBWHS_SHIP_DATE>='20210930' AND WHS.DBWHS_STATUS='3'


All the best,

Richard Reeve
--
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.

Help support midrange.com by shopping at amazon.com with our
affiliate
link: https://amazon.midrange.com
--
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.

Help support midrange.com by shopping at amazon.com with our affiliate
link: https://amazon.midrange.com

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

Help support midrange.com by shopping at amazon.com with our affiliate link: https://amazon.midrange.com


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2022 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.