Books & Videos

Table of Contents

  1. Chapter 1 Introduction

    1. Why Tune SQL?

    2. Who Should Tune SQL?

    3. How This Book Can Help

    4. A Bonus

    5. Outside-the-Box Solutions

  2. Chapter 2 Data-Access Basics

    1. Caching in the Database

    2. Tables

    3. Indexes

    4. Uncommon Database Objects

    5. Single-Table Access Paths

    6. Calculating Selectivity

    7. Joins

  3. Chapter 3 Viewing and Interpreting Execution Plans

    1. Reading Oracle Execution Plans

    2. Reading DB2 Execution Plans

    3. Reading SQL Server Execution Plans

  4. Chapter 4 Controlling Execution Plans

    1. Universal Techniques for Controlling Plans

    2. Controlling Plans on Oracle

    3. Controlling Plans on DB2

    4. Controlling Plans on SQL Server

  5. Chapter 5 Diagramming Simple SQL Queries

    1. Why a New Method?

    2. Full Query Diagrams

    3. Interpreting Query Diagrams

    4. Simplified Query Diagrams

    5. Exercises (See Section A.1 for the solution to each exercise.)

  6. Chapter 6 Deducing the Best Execution Plan

    1. Robust Execution Plans

    2. Standard Heuristic Join Order

    3. Simple Examples

    4. A Special Case

    5. A Complex Example

    6. Special Rules for Special Cases

    7. Exercise (See Section A.2 for the solution to the exercise.)

  7. Chapter 7 Diagramming and Tuning Complex SQL Queries

    1. Abnormal Join Diagrams

    2. Queries with Subqueries

    3. Queries with Views

    4. Queries with Set Operations

    5. Exercise (See Section A.3 for the solution to the exercise.)

  8. Chapter 8 Why the Diagramming Method Works

    1. The Case for Nested Loops

    2. Choosing the Driving Table

    3. Choosing the Next Table to Join

    4. Summary

  9. Chapter 9 Special Cases

    1. Outer Joins

    2. Merged Join and Filter Indexes

    3. Missing Indexes

    4. Unfiltered Joins

    5. Unsolvable Problems

  10. Chapter 10 Outside-the-Box Solutions to Seemingly Unsolvable Problems

    1. When Very Fast Is Not Fast Enough

    2. Queries that Return Data from Too Many Rows

    3. Tuned Queries that Return Few Rows, Slowly

  1. Appendix A Exercise Solutions

    1. Chapter 5 Exercise Solutions

    2. Chapter 6 Exercise Solution

    3. Chapter 7 Exercise Solution

  2. Appendix B The Full Process, End to End

    1. Reducing the Query to a Query Diagram

    2. Solving the Query Diagram

    3. Checking the Execution Plans

    4. Altering the Database to Enable the Best Plan

    5. Altering the SQL to Enable the Best Plan

    6. Altering the Application

    7. Putting the Example in Perspective

  3. Glossary

  4. Colophon