Contents
Chapter 1 SQL Optimization Top 100+
1. Take Out Any/All Scalar Functions Coded on Columns in Predicates
2. Take Out Any/All Mathematics Coded on Columns in Predicates
3. Code Only the Columns Needed in the Select Portion of the SQL Statement
4. Stay Away from Distinct if Possible
5. Try Rewriting an In Subquery as an Exists Subquery
6. Always Make Sure Host Variables Are Defined to Match the Columns Datatype
7. Because Or Logic Can Be Problematic to the Optimizer, Try a Different Rewrite
9. Use UNION ALL in Place of UNION Where Possible
10. Consider Hardcoding Versus Using a Host Variable
Get DB2 SQL Tuning Tips for z/OS Developers now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.