O'Reilly logo

DB2 SQL Tuning Tips for z/OS Developers by Tony Andrews

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 2. DB2 SQL Hints

Every RDBMS has hints you can code in SQL statements to try to get the optimizer to choose something different in its optimization. For example, you might want to direct DB2 to choose a different index, a different order of the table flow, or a different join method. You use these hints when the access path for an SQL statement does not perform very well and all other options, including the following, have been exhausted:

• Rewriting the query a different way

• Hard coding rather than using host variables

• Reorganizing the table and index files

• Using runstats for the tables involved

• Using frequency value runstats for specific columns involved

• Redesigning any appropriate indexes

• Rewriting predicates yet keeping ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required