Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I improve my the speed of my SQL statement?

SQL

How do I improve my the speed of my SQL statement?

by  iSeriesCodePoet  Posted    (Edited  )
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.
Register to rate this FAQ  : BAD 1 2 3 4 5 6 7 8 9 10 GOOD
Please Note: 1 is Bad, 10 is Good :-)

Part and Inventory Search

Back
Top