Re: Is the query engine always smart enough to know when to generate an internal CTE on a query?
Jim Oberholtzer <midrangel-zbO79nAUJZvJTQUaaPvyeQC/[email protected]>
| Newsgroups | gmane.comp.hardware.ibm.midrange |
|---|---|
| Message-ID | <[email protected]> |
Potentially, however not likely. When the system then builds the access path, either temporary or permanent depending on your actions, it will take some space. That said, it’s been many years since I’ve seen a system that had an issue with storage due to index activity or additional access paths. More likely is the temporary address percentage will climb a bit as it manages the storage for the temporary objects if you don’t create permanent ones, but even that is not going to materially affect the system. Short answer: No. -- Jim Oberholtzer Agile Technology Architects > On Aug 7, 2026, at 9:11 AM, Dan Bale via MIDRANGE-L <[email protected]> wrote: > > Thanks to everyone for their responses! > > The index advisor recommended 3 indexes on the primary table. Can the lack of recommended indexes impact temporary storage? > > - Dan Bale > > -----Original Message----- > From: MIDRANGE-L <[email protected]> On Behalf Of Vern Hamberg via MIDRANGE-L > Sent: Friday, August 7, 2026 9:31 AM > To: [email protected] > Cc: Vern Hamberg <[email protected]> > Subject: Re: Is the query engine always smart enough to know when to generate an internal CTE on a query? > > Hi Dan > > I think others have mentioned this, and I'll stay say it - run both versions - with and without CTE - in Visual Explain. First see if there are table scans in the "without" version, then see if you can see why - I know you know this stuff, too. See if there are indexes recommended, of course. Are the WHEREs internal to that main table? I'm inclined to say both will be similar. > > Now using a CTE, that always seems similar to having a view that is the same thing - views are executed at run-time but they simplify the syntax, same as one of the replies said, to segregate complexity - I made that phrase up, I think! :) > > Anyhow, good luck, it'll be interesting to hear your results. > > *Regards* > > *Vern Hamberg* > > IBM Champion 2025 <cid:[email protected]> CAAC (COMMON Americas Advisory Council) IBM Influencer 2023 > *** CONFIDENTIALITY NOTICE: The information contained in this communication may be confidential, and is intended only for the use of the recipients named above. If the reader of this message is not the intended recipient, you are hereby notified that any dissemination, distribution, or copying of this communication, or any of its contents, is strictly prohibited. If you have received this communication in error, please return it to the sender immediately and delete the original message and any copy of it from your computer system. If you have any questions concerning this message, please contact the sender. *** > -- > This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list > To post a message email: [email protected] > To subscribe, unsubscribe, or change list options, > visit: https://lists.midrange.com/mailman/listinfo/midrange-l > or email: [email protected] > Before posting, please take a moment to review the archives > at https://archive.midrange.com/midrange-l. > > Please contact [email protected] for any subscription related questions. > > You can help support midrange.com by visiting https://donate.midrange.com and making a contribution. -- This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list To post a message email: [email protected] To subscribe, unsubscribe, or change list options, visit: https://lists.midrange.com/mailman/listinfo/midrange-l or email: [email protected] Before posting, please take a moment to review the archives at https://archive.midrange.com/midrange-l. Please contact [email protected] for any subscription related questions. You can help support midrange.com by visiting https://donate.midrange.com and making a contribution.