DB2 SQL Tuning Tips for z/OS Developers

DB2 SQL Tuning Tips for z/OS Developers
Nicht lieferbar | Lieferzeit: Nicht lieferbar I

38,50 €*

Alle Preise inkl. MwSt. | Versandkostenfrei
Artikel-Nr:
9780133038460
Veröffentl:
2012
Seiten:
160
Autor:
Tony Andrews
Gewicht:
226 g
Format:
227x155x10 mm
Sprache:
Englisch
Beschreibung:

Tony Andrews has more than 23 years' experience in the development of IBM DB2 relational database applications. Most of this time, he has provided development and consulting services to Fortune 500 companies and government agencies. Tony has written literally thousands of queries and programs during his development years, and he has also served as a DB2 database analyst. For the past 10 years, Tony has been splitting his time between consulting engagements and training. His main focus is to teach today's developers the ways of RDMS application design, development, and SQL programming- always with a special emphasis on improving performance. Tony's training, consulting, and speaking engagements are through his employer, Themis, Inc., an onsite and virtual instructor-led, hands-on IT training company recognized internationally. It offers more than 400 IT courses and helps to support International DB2 Users Group North America (IDUG NA) and Europe, Middle East, and Africa (IDUG EMEA), along with many DB2 user groups.Tony is a current IBM champion and regular lecturer at industry conferences and local user groups. You may have seen him present at such events as IDUG NA and EMEA. He is well known for his "Top 25+ Tuning Tips for Developers" presentation.Tony graduated from Ohio State University with a major in business and a minor in mathematical statistics. He currently resides in Dublin, Ohio.
The Definitive Solutions-Oriented Guide to IBM® DB2® for z/OS®: Now Fully Updated for Both v9 and v10!The largest database tuning performance gains can often be obtained from tuning application code, and applications that use SQL to retrieve data are the best candidates for tuning. This well-organized, easy-to-understand reference brings together more than 100 SQL-related skills and techniques that any developer can use to build and optimize DB2 applications for consistently superior performance.DB2 tuning expert Tony Andrews ("Tony the Tuner") draws on more than 20 years of DB2-related experience, empowering you to take performance into your own hands, whether you're writing new software or tuning existing systems. Tony shows you exactly how to clear bottlenecks, resolve problems, and improve both speed and reliability.This book fully reflects the latest SQL programming best practices for DB2 V9 and DB2 V10 on z/OS: techniques that are taught in no other book and are rarely covered in general DB2 SQL courses. Drawing on his extensive consulting experience and highly praised training with Themis Inc., Tony also presents practical checklists and an invaluable 15-step methodology for optimizing virtually any DB2 application.Coverage includes
CHAPTER 1 SQL Optimization Top 100+ 11. Take Out Any/All Scalar Functions Coded on Columns in Predicates 22. Take Out Any/All Mathematics Coded on Columns in Predicates 33. Code Only the Columns Needed in the Select Portion of the SQL Statement 44. Stay Away from Distinct if Possible 45. Try Rewriting an In Subquery as an Exists Subquery 56. Always Make Sure Host Variables Are Defined to Match the Columns Datatype 67. Because Or Logic Can Be Problematic to the Optimizer, Try a Different Rewrite 68. Make Sure the Data Distribution and Other Statistics Are Good and Current in the Tables Being Processed 89. Use UNION ALL in Place of UNION Where Possible 910. Consider Hardcoding Versus Using a Host Variable 911. Minimize DB2's SQL Requests 1112. Try Rewriting Range Predicates as Between Predicates 1213. Consider Using Global Temporary Tables 1314. Give Prominence to Stage 1 over Stage 2 Predicates 1415. Remember That the Order of (Some) Predicates Does Matter 1516. Streamline Multiple Subqueries 1617. Index Correlated Subqueries 1718. Get to Know the DB2 Explain Tool 1719. Use Tools for Monitoring 1820. Employ Commit and Restart Strategies 1921. Implement Good Index Design 1922. Avoid Discrepancies with Non-Column Expressions 2023. Begin with All Filtering Logic Outside Application Code 2124. Ensure That Subquery Predicates Involving Min and Max Have the Possibility of Nulls Being Returned Handled 2125. Always Code For Fetch Only or For Read Only with Cursor Processing When a Query Is Only Selecting Data 2226. Avoid Selecting a Row from a Table to Help Decide Whether the Logic in the Code Should Execute anUpdate or an Insert 2327. Avoid Selecting a Row from a Table in Order to Get Values for an Update 2328. Make Use of Dynamic SQL Statement Caching 2329. Avoid Using Select * 2430. Watch Out for Nullable Columns or Times When SQL Statements Could Have Nulls Returned from the Database Manager 2531. Minimize the Number of Times Open and Close Cursors Are Executed 2532. Avoid Not Logic in SQL 2633. Use Correlation IDs for Better Readability 2634. Keep Table and Index Files Healthy and Organized 2735. Take Advantage of Update Where Current of Cursor and Delete Where Current of Cursor 2736. When Using Cursors, Use ROWSET Positioning and Fetching Using Multiple-Row Fetch, Multiple-Row Update, and Multiple-Row Insert 2837. Know the Locking Isolation Levels 2838. Know Null Processing 3039. Always Program with Performance in Mind 3140. Let SQL Do the Work 3241. Code with Lock Table 3242. Consider OLTP Front-End Processing 3343. Consider Using Dynamic Scrollable Cursors 3444. Take Advantage of Materialized Query Tables to Improve Response Time (Dynamic SQL Only) 3545. Insert with Select 3746. Take Advantage of Multiple-Row Fetch 3847. Take Advantage of Multiple-Row Insert 3948. Take Advantage of Multiple-Row Update 4049. Take Advantage of Multiple-Row Delete 4250. Try Scalar Fullselects Within the Select Clause 4251. Take Advantage of REOPT ONCE and REOPT AUTO in Dynamic SQL and REOPT VARS and REOPT ALWAYS in Static SQL 4352. Identify Times for Volatile Tables 4453. Use the ON COMMIT DROP Enhancement 4554. Use Multiple Distincts 4555. Take Advantage of Backward Index Scanning 4656. Watch Out for the Like Statement 4657. Set Your Clustering Index Correctly 4758. Use Group By Expressions if Needed 4859. Watch Out for Tablespace Scans 4860. Do Not Ask for What You Already Know 4961. Watch the Order of Tables in a Query 4962. Use Left Outer Joins Over Right Outer Joins 5163. Check for Non-Existence 5164. Use Stored Procedures 5265. Do Not Select a Column in Order to Sort on It 5366. Always Limit the Result Set if Possible 5367. Take Advantage of DB2 V8 Enhanced DISCARD Capabilities When It Comes to Mass Deletes 5468. Take Advantage of the DB2 LOAD Utility for Mass Inserts 5469. Watch Out for Materialization of Views, Nested Table Expressions, and Common Table Expressions 5570. Consider Compressing Data 5671. Consider Parallelism 5772. Keep the STDDEV, STDDEV_SAMP, VAR, and VAR_SAMP Functions Apart from Other Functions 5873. Consider Direct Row Access Using ROWID Datatype (V8) or RID Function (V9) 5874. Test Your Queries with Realistic Statistics and a Level of Data to Reflect Performance Issues 6075. Specify the Leading Index Columns in WHERE Clauses 6176. Use WHERE Instead of HAVING for Filtering Whenever Possible 6277. Keep in Mind Index Only Processing Whenever Possible 6278. Index on Expression in DB2 V9 6379. Consider the DB2 V9 Truncate Statement 6480. Use DB2 V9 Fetch First and Order by Within Subqueries 6581. Take Advantage of DB2 V9 Optimistic Locking 6582. Use the DB2 V9 MERGE Statement 6683. Understand the DB2 NOFOR Precompile Option 6884. Consider Select Into Using Order By 6985. Code Boolean Term Predicates Whenever Possible 6986. Try Transitive Closure Coding 7087. Avoid Sorts with Order By 7188. Use Joins Instead of Subqueries Whenever Possible 7189. Watch Out for Case Logic 7190. Take Advantage of Functions in the Order By Clause 7291. Know Your Version of DB2 7292. Understand Date Arithmetic 7393. Know Your High-Volume Insert Choices 7394. Know About Skip Locked Data (V9) for Lock Avoidance. . . . . .7595. Sort Your Input Streams 7596. If You Need True Uniqueness, Try the V8 Generate_Unique Function 7697. Know the New Options for Declared Temporary Tables 7698. Watch Out When Executing Get Diagnostics 7799. Order Your In List Appropriately 77100. Update and Delete with Select (V9) 77101. Execute SQL Statements Only if Necessary 78102. Take Advantage of In-Memory Tables 78103. Stay Away from Catchall SQL Statements 79104. Avoid Unnecessary Sorting 79105. Understand Expressions and Column Functions 79106. Watch Out When Combining Predicates 80107. Add Redundant Predicates to Search Queries 80108. Take Advantage of Improved Dynamic Caching (V10) 81109. Try Currently Committed for Lock Avoidance (V10) 82110. Try System Temporal Tables for Historical Data (V10) 83111. Try Business Temporal Tables for Historical Data (V10) 85112. Know Your Ranking Functions (V10) 86113. Take Advantage of Extended Indicators (V10) 87114. Get Greater Timestamp Precision (V10) 88115. Try Index Includes (V10) 89116. Use With Return to Client (V10) 89CHAPTER 2 DB2 SQL Hints 911. Try the Optimize for 1 Row Statement at the End of the SQL Statement 912. Add the A.PKEY = A.PKEY Predicate to the SQL Query, Where PKEY Equals the Primary Key Column of the Table 923. Disqualify an Index Choice 934. Change the Order of Table Processing 955. Use Distributed Dynamic SQL 96CHAPTER 3 SQL Standards and Guidelines 99For COBOL Developers 99For All SQL Developers 102CHAPTER 4 SQL Program Walkthroughs 107CHAPTER 5 Existence Checking 111Example 1 111Example 2 113CHAPTER 6 Runstats 115CHAPTER 7 Initial Steps in Tuning a Query 117APPENDIX A Predicate Rewrite Examples 121Predicate Rewrites: Transitive Closure 122APPENDIX B DB2 SQL Terminology 125Index 131

Kunden Rezensionen

Zu diesem Artikel ist noch keine Rezension vorhanden.
Helfen sie anderen Besuchern und verfassen Sie selbst eine Rezension.