rent-now

Rent More, Save More! Use code: ECRENTAL

5% off 1 book, 7% off 2 books, 10% off 3+ books

9780596005733

SQL Tuning

by
  • ISBN13:

    9780596005733

  • ISBN10:

    0596005733

  • Format: Paperback
  • Copyright: 2003-12-01
  • Publisher: Oreilly & Associates Inc
  • Purchase Benefits
  • Free Shipping Icon Free Shipping On Orders Over $35!
    Your order must be $35 or more to qualify for free economy shipping. Bulk sales, PO's, Marketplace items, eBooks and apparel do not qualify for this offer.
  • eCampus.com Logo Get Rewarded for Ordering Your Textbooks! Enroll Now
List Price: $39.95 Save up to $1.56
  • Buy New
    $39.91
    Add to Cart Free Shipping Icon Free Shipping

    USUALLY SHIPS IN 2-3 BUSINESS DAYS

Summary

A poorly performing database application not only costs users time, but has an impact on other applications running on the same computer or the same network. SQL Tuning provides the essential next step for SQL developers and database administrators who want to extend their SQL tuning expertise and get the most out of their database applications. Content includes how to understand and control SQL execution plans, and how to diagram SQL queries to deduce the best execution plan for the query. Each chapter includes exercises to reinforce concepts, and SQL Tuning concludes by addressing special cases and "outside the box solutions to unsolvable problems."

Author Biography

Dan Tow is an independent consultant, operating under the banner SingingSQL (www.singingsql.com). His experience solving Oracle-related performance problems goes all the way back to his 1989 hire by Oracle Corporation. During most of his tenure at Oracle, Dan focused on the performance of Oracle Applications, managing the performance group for that division. In this role, he found a fertile testing ground for his SQL tuning method applied to the huge set of complex SQL included in those applications, including both online SQL and diverse batch processes. In 1998, Dan left Oracle to lead performance for TenFold Corporation, where he applied the same methods to tuning questions on DB2, and SQL Server, and Sybase, as well as on Oracle. In 2002, Dan started his own business, SingingSQL, through which he offers diverse database-related tuning services, including SQL tuning and systematically analyzing load to learn which SQL should be tuned. He has introduced his SQL tuning method to over 1,000 people in short lectures, and now offers in-depth courses in the material, using this book as textbook. Dan has a Ph.D. in chemical engineering from the University of Wisconsin at Madison. He lives in Palo Alto, California, and can be reached at dantow@singingsql.com.

Table of Contents

Foreword xi
Preface xiii
1. Introduction 1(7)
Why Tune SQL?
1(2)
Who Should Tune SQL?
3(1)
How This Book Can Help
4(2)
A Bonus
6(1)
Outside-the-Box Solutions
7(1)
2. Data-Access Basics 8(35)
Caching in the Database
9(3)
Tables
12(3)
Indexes
15(3)
Uncommon Database Objects
18(4)
Single-Table Access Paths
22(5)
Calculating Selectivity
27(9)
Joins
36(7)
3. Viewing and Interpreting Execution Plans 43(30)
Reading Oracle Execution Plans
44(10)
Reading DB2 Execution Plans
54(11)
Reading SQL Server Execution Plans
65(8)
4. Controlling Execution Plans 73(35)
Universal Techniques for Controlling Plans
73(11)
Controlling Plans on Oracle
84(14)
Controlling Plans on DB2
98(4)
Controlling Plans on SQL Server
102(6)
5. Diagramming Simple SQL Queries 108(26)
Why a New Method?
108(2)
Full Query Diagrams
110(16)
Interpreting Query Diagrams
126(2)
Simplified Query Diagrams
128(2)
Exercises
130(4)
6. Deducing the Best Execution Plan 134(42)
Robust Execution Plans
134(2)
Standard Heuristic Join Order
136(1)
Simple Examples
137(8)
A Special Case
145(2)
A Complex Example
147(4)
Special Rules for Special Cases
151(23)
Exercise
174(2)
7. Diagramming and Tuning Complex SQL Queries 176(52)
Abnormal Join Diagrams
177(26)
Queries with Subqueries
203(13)
Queries with Views
216(9)
Queries with Set Operations
225(2)
Exercise
227(1)
8. Why the Diagramming Method Works 228(10)
The Case for Nested Loops
228(2)
Choosing the Driving Table
230(3)
Choosing the Next Table to Join
233(3)
Summary
236(2)
9. Special Cases 238(12)
Outer Joins
238(5)
Merged Join and Filter Indexes
243(3)
Missing Indexes
246(1)
Unfiltered Joins
247(1)
Unsolvable Problems
248(2)
10. Outside-the-Box Solutions to Seemingly Unsolvable Problems 250(19)
When Very Fast Is Not Fast Enough
250(4)
Queries that Return Data from Too Many Rows
254(11)
Tuned Queries that Return Few Rows, Slowly
265(4)
A. Exercise Solutions 269(13)
B. The Full Process, End to End 282(13)
Glossary 295(8)
Index 303

Supplemental Materials

What is included with this book?

The New copy of this book will include any supplemental materials advertised. Please check the title of the book to determine if it should include any access cards, study guides, lab manuals, CDs, etc.

The Used, Rental and eBook copies of this book are not guaranteed to include any supplemental materials. Typically, only the book itself is included. This is true even if the title states it includes any access cards, study guides, lab manuals, CDs, etc.

Rewards Program