Dear Michael
It would be better if you try to explain goal(s) that you want to achieve when you mentioned "reuse". Db2 for i makes a decision to "reuse" an access plan in the Plan Cache automatically by itself. There is no manual way for programmer to do this. Do you mean a "reuse" by human? If so, for what purpose?
>>>> Somebody tell me I can recover Plan cache without manually creating every index that has been recommended, please. <<<<
You have or remember an inaccurate information.
Each index that you create is a "permanent" one until you explicitly delete it. I suspect that you may be thinking about "Autonomic Indexes" (MTI - Maintained Temp Index) created by DB2 for i but they do not exist as permanent logical file objects.
After you apply the cumulative PTF package, a system IPL will clean away all the entries in Plan Cache and all MTIs. After the IPL, Plan Cache content will start from scratch to build up one by one as well as MTIs. For Plan Cache content, you can dump its snapshot image out (with QSYS2.DUMP_PLAN_CACHE procedure) before the IPL ( https://www.ibm.com/docs/en/i/7.4?topic=cache-creating-snapshots ) but this is for the purpose of the ability to look into past plan cache entries for analysis by human (Is this what you meant by "reuse"?), NOT for DB2 for i to "reuse" it after IPL.
As for MTIs, you should identify them and create them as permanent indexes before the IPL. Scott Forstie provides a utility for this here: https://www.ibm.com/support/pages/node/6347648 (search for "mti" in the page). Some of my IBM i customers who have a lot of SQL/Queries workload in their systems, but "unknowingly" have very many MTIs because they create very few, if at all, advised indexes, encounter abnormally slow performance after an IPL because all MTIs are gone and need time to be re-created as the workload run. Is this a situation that you want to avoid?
------------------------------
Satid S
------------------------------
Original Message:
Sent: Fri September 27, 2024 11:29 AM
From: michael woodard
Subject: It's been asked and answer before, "How to reuse sql plan cache snapshot on IBM i?"
It's been asked and answer before, "How to reuse sql plan cache snapshot on IBM i?". Our "Plan cache hit ratio is 83%" and we are putting a CUM on this weekend. Somebody tell me I can recover Plan cache without manually creating every index that has been recommended, please.
------------------------------
michael woodard
------------------------------