1) On the command line do a STRDBG.
2) Go into STRSQL and process your SQL statement.
3) Exit SQL
4) Do a DSPJOBLOG, press F10 then page up.
5) Find a log entry similar to: "Access path suggestion for file XXXXXXX". This will have your logical suggestion
Within this log is some optimization suggestions. Create a logical based on that and it will improve your speed some.
Reason this happens: When you execute an SQL statement, DB2 looks for a pre-built logical to use. It looks looks for a short bit, if it doesn't find one, it will build one. Building that logical can take quite a while. By building this logical for DB2, you are cutting out that time it takes to build it.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.