Join Amazon Prime and ship Two-Day for free and Overnight for $3.99. Already a member? Sign in.
SQL Tuning and over 300,000 other books are available for Amazon Kindle – Amazon’s new wireless reading device. Learn more

 

or
Sign in to turn on 1-Click ordering.
 
 
More Buying Choices
44 used & new from $13.05

Have one to sell? Sell yours here
 
   
SQL Tuning
 
 
Start reading SQL Tuning on your Kindle in under a minute.

Don’t have a Kindle? Get yours here.
 
  
4.7 out of 5 stars See all reviews (15 customer reviews)

List Price: $39.95
Price: $26.37 & this item ships for FREE with Super Saver Shipping. Details
You Save: $13.58 (34%)
o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o
In Stock.
Ships from and sold by Amazon.com. Gift-wrap available.

Want it delivered Tuesday, July 21? Choose One-Day Shipping at checkout. Details
27 new from $21.36 17 used from $13.05
Also Available in: List Price: Our Price: Other Offers:
Kindle Edition (Kindle Book) $17.59
Like this book? Find similar titles from O'Reilly and Partners in our O'Reilly Bookstore.

Best Value

Buy Database in Depth: Relational Theory for Practitioners and get SQL Tuning at an additional 5% off Amazon.com's everyday low price.

Database in Depth: Relational Theory for Practitioners + SQL Tuning
Buy Together Today: $52.00

Show availability and shipping details


Customers Who Bought This Item Also Bought

SQL Cookbook (Cookbooks (O'Reilly))

SQL Cookbook (Cookbooks (O'Reilly))

by Anthony Molinaro
4.7 out of 5 stars (44)  $26.37
Oracle SQL Tuning Pocket Reference

Oracle SQL Tuning Pocket Reference

by Mark Gurry
5.0 out of 5 stars (4)  $9.95
The Art of SQL

The Art of SQL

by Stephane Faroult
4.7 out of 5 stars (18)  $29.69
Learning SQL

Learning SQL

by Alan Beaulieu
4.4 out of 5 stars (27)  $26.39
Inside Microsoft® SQL Server(TM) 2005: Query Tuning and Optimization

Inside Microsoft® SQL Server(TM) 2005: Query Tuning and Optimization

by Kalen Delaney
4.4 out of 5 stars (8)  $31.49
Explore similar items

Editorial Reviews

Product Description
A poorly performing database application not only costs users time, but also has an impact on other applications running on the same computer or the same network. SQL Tuning provides an essential next step for SQL developers and database administrators who want to extend their SQL tuning expertise and get the most from their database applications.

There are two basic issues to focus on when tuning SQL: how to find and interpret the execution plan of an SQL statement and how to change SQL to get a specific alternate execution plan. SQL Tuning provides answers to these questions and addresses a third issue that's even more important: how to find the optimal execution plan for the query to use.

Author Dan Tow outlines a timesaving method he's developed for finding the optimum execution plan--rapidly and systematically--regardless of the complexity of the SQL or the database platform being used. You'll learn how to understand and control SQL execution plans and how to diagram SQL queries to deduce the best execution plan for a query. Key chapters in the book include exercises to reinforce the concepts you've learned. SQL Tuning concludes by addressing special concerns and unique solutions to "unsolvable problems."

Whether you are a programmer who develops SQL-based applications or a database administrator or other who troubleshoots poorly tuned applications, SQL Tuning will arm you with a reliable and deterministic method for tuning your SQL queries to gain optimal performance.

About the Author
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.


Product Details

  • Paperback: 336 pages
  • Publisher: O'Reilly Media, Inc.; 1st edition (December 1, 2003)
  • Language: English
  • ISBN-10: 0596005733
  • ISBN-13: 978-0596005733
  • Product Dimensions: 9 x 6.9 x 0.9 inches
  • Shipping Weight: 1.2 pounds (View shipping rates and policies)
  • Average Customer Review: 4.7 out of 5 stars See all reviews (15 customer reviews)
  • Amazon.com Sales Rank: #45,250 in Books (See Bestsellers in Books)

    Popular in these categories: (What's this?)

    #73 in  Books > Computers & Internet > Databases > Database Management Systems
    #84 in  Books > Computers & Internet > Databases > SQL

Inside This Book (learn more)

What Do Customers Ultimately Buy After Viewing This Item?

SQL Tuning
66% buy the item featured on this page:
SQL Tuning 4.7 out of 5 stars (15)
$26.37
SQL Cookbook (Cookbooks (O'Reilly))
16% buy
SQL Cookbook (Cookbooks (O'Reilly)) 4.7 out of 5 stars (44)
$26.37
Oracle SQL Tuning Pocket Reference
7% buy
Oracle SQL Tuning Pocket Reference 5.0 out of 5 stars (4)
$9.95
The Art of SQL
7% buy
The Art of SQL 4.7 out of 5 stars (18)
$29.69

Tags Customers Associate with This Product

 (What's this?)
Click on a tag to find related items, discussions, and people.
Check the boxes next to the tags you consider relevant or enter your own tags in the field below.
(4)

Your tags: Add your first tag
 
Help others find this product — tag it for Amazon search
No one has tagged this product for Amazon search yet. Why not be the first to suggest a search for which it should appear?

 

Customer Reviews

15 Reviews
5 star:
 (13)
4 star:
 (1)
3 star:    (0)
2 star:
 (1)
1 star:    (0)
 
 
 
 
 
Average Customer Review
4.7 out of 5 stars (15 customer reviews)
 
 
 
 
Share your thoughts with other customers:
Most Helpful Customer Reviews

 
57 of 57 people found the following review helpful:
5.0 out of 5 stars Quick solutions for difficult optimization problems, January 24, 2004
By Charles D. Simmons (Dallas, TX USA) - See all my reviews
(REAL NAME)   
"Tell me something I don't already know", that's what crosses my mind every time I pick up a new performance, tuning book. If you're like me, 90% of the content in any DBA book in the store is 'old hat'.

This book is refreshing. It doesn't waste time going over all of the stuff you learned years ago.

Knowing how to read an execution plan or when to pick a hash join over a nested loop join is not what this book is about. There are plenty of books on the market that cover basic, vendor specific, query tuning. I personally have about 20 of these books on my bookshelf here at home. (Over the years I've worked on Sybase, SQL Server, Informix XPS, & Oracle.)

Here's the deal...

Anyone who has worked with really big systems will eventually run into an optimization problem that seems to be unsolvable. You can try histograms, compressed key indexes, partitioning, pre-joined indexes, and materialized views, but you still can't get the performance that's being requested. For a DBA, it can be a very frustrating dilemma. This is especially true when you know from the data volume that you should be able to get there.

The truth is, optimizers can't always get the right solution, even with correct statistics. There are some good technical reasons why this is true, but that's out of scope for my review. In any case, that's where this book comes to the rescue. I feel that it gives you some insight into the optimization problem and tells you how to correct the problems that your optimizer can't figure out.

This book is NOT for use on 95% of your queries. Most optimizers will pick the correct access plan if the DBA does his/her job correctly and collects the appropriate statistics.

In my experience, I get two types of problems that I have trouble getting the optimizer to solve:

#1. Joining together a large number (8-14) of tables. At least 1 or 2 of the tables have over 30G of real data. By `real data', I mean that 30G of data is actually populated.

#2. Making high transaction queries read the fewest amount of buffers in order to get rid of latching problems.

After I read the first few diagramming chapters of this book, I thought I'd give it a try on a problem that was recently solved at work. I was surprised. It worked, and even with my clumsiness with the method, it only took me about 2 hours to get a solution. It took us about 3 days at work. Our trial and error solution was slightly better, than what I came up with using the author's method. However, it was so close that had I used his method, I most certainly would have gone on to another problem. (The author's solution was strange because I would never have solved the join order the way that he did. His solution actually had me pick the largest table, out of 10, to drive the query. I thought this was odd because my test query had some very good filters on smaller tables.)

These were the results per execution:

Optimizer - 100K buffers.
Trial & Error - 1700 buffers.
Book method (basic graphing) - 2000 buffers.

If I had known about this book, I could have solved this problem in a few hours. Instead it took several DBA's, a few day's time to come up with a solution that was only marginally better.

Since this method appeared to work so well for OLTP, I went back and looked at a very large OLAP query that I had worked on last year. I and several developers had spent days trying to get it to run faster. Even with the author's method, I still couldn't make it better, but I was happy to see that the join order picked by the optimizer was almost identical to what I had calculated using the book.

I plan on studying this guide over and over until I've memorized this method. I don't think it will solve every problem, but I think it gives you an edge over using experience alone.

Before you purchase this book...

Keep in mind, that SQL tuning is fundamentally *not a simple problem*, so readers should not buy the book expecting an easy list of simple tips and tricks. (If the problem was easy, the optimizer likely would have got it right in the first place, and you wouldn't be tuning!) The correct solution to the problem is fairly complex, as complex as it *needs* to be.

Also, it's not noted anywhere, but I gathered that the author assumes that the reader will have basic high school Algebra skills, and will have taken a basic statistics course in order to fully understand the reasoning behind the explanations. Although, Algebra and statistical knowledge are probably not necessary to learn the tuning method presented. I state this because I told a good friend about this book, and his first question was, "Does it have a lot of math to go through?" So, if statistics is not your thing, don't worry. The author only presents enough information to give you a level of comfort that his method is based on mathematics. He doesn't require that you know "graph theory" or anything like that.

By the way, our change from 100K buffers per transaction to 1700 buffers, dropped the CPU utilization for the website that was running the OLTP query by about 70%. That was on a 16 CPU, Sun/Solaris box. So proper SQL tuning can save you a lot of $$$.

Comment Comment (1) | Permalink | Was this review helpful to you? Yes No (Report this)



 
9 of 9 people found the following review helpful:
5.0 out of 5 stars A Work of Genius, July 21, 2006
By Kurt Survance (Portland, OR) - See all my reviews
(REAL NAME)   
I have withdrawn my earlier review because I did not properly understand the importance of this book until the second reading. That is a difficult admission to make since my business is database performance tuning.

This book is about tuning SQL queries in a systematic and scientific manner. It is above all about determining the optimum order in which the query engine should access the tables involved. My quibble was that join order is only a part of the whole tuning problem and most of the time the query optimizer got it right anyway. While this is true, I see now that it misses the point.

The fact that the optimizer gets it right so often allows us to take join order for granted. But how do we know the optimizer got it right unless we know what the optimum join order is? That is what this book teaches, a methodology and an elegant system of notation that allows us to determine the optimum join order of the most complex query. As the author points out, the number of possible join orders increases factorially with the number of tables involved. An 8 table join has 40,320 possible join orders. That rules out trial and error for all but the simplest queries.

It turns out that analyzing and diagramming according to Tow's method gives you a deep architectural understanding of the query and the problems that face you. It gives you a plan to which you can apply the tools of the trade, indexes, code optimization, etc.

This is a book that will be on the shelf of serious performance tuning professionals for as long as SQL is the language of data manipulation.
Comment Comment | Permalink | Was this review helpful to you? Yes No (Report this)



 
18 of 21 people found the following review helpful:
5.0 out of 5 stars Critically necessary work, February 26, 2004
Most all database driven applications are going to use an SQL RDBMS. Whether you wrap them in an O/R mapping layer or write the SQL directly you are going to get to SQL at some time. And often you will find that you need to be able to tune and optimize some of the critical queries for the best performance. But how do you get there?

SQL Tuning covers reading the execution plans, tweaking the queries and diagramming the plans so that you can understand what the server is doing and how to optimize it.

This is a unique book for O'Reilly which is a publisher most at home with works that are mainly code or API references. This book instead teaches a methodology and does it well. No quick fixes or cookbook style approaches are presented. This book teaches action through a deep understanding of the topic at hand, and if you use SQL on systems that require high performance then this is an understanding relevant to you.

Here are the key chapters:

Chapter two presents the internal of the database in a solid introductory manner.

Chapter three teaches you how to read execution plans.

Chapter four teaches you how to control those plans on Oracle, DB2 and SQL Server.

Chapter five teaches you a way to diagram the plans to understand the in more detail.

Chapter six shows you how to analyse those plans then then turn that into a new execution optimized execution plan.

As you can see, no quick fixes here. This is a book about a methodology and how to apply it. Bravo O'Reilly and Dan Tow for this important and unique work.

Comment Comment | Permalink | Was this review helpful to you? Yes No (Report this)


Share your thoughts with other customers: Create your own review
 
 
Ad
 
Most Recent Customer Reviews

5.0 out of 5 stars Excellent resource for the Oracle DBA
Dan Tow has created a marvelous resource. With complex queries, it is often uncertain what is the best query plan. Dan Tow takes the mystery out of that process. Read more
Published on January 9, 2007 by Dennis W. Willaims

5.0 out of 5 stars The first real SQL Tuning method.
I have worked with Oracle databases and SQL tuning since 1987, and the reason I recommend Dan's book so highly to anyone working with SQL is that his method is the first real... Read more
Published on February 27, 2006 by Miracle

5.0 out of 5 stars excellect condition
like new as described,fast shipment.
Published on January 15, 2006 by Gerald J. Gomes

5.0 out of 5 stars A Real Job Saver
I was entangled in the web of horrible response time queries, not knowing what to do (except the darn hit ratios were maximum). Read more
Published on July 27, 2005 by Fahd Mirza

5.0 out of 5 stars Absolute needed book for a SQL tuning specialist
As a senior data warehousing specialist, I used several tools and books for tuning SQL so far and none of is giving the methodology needed. Read more
Published on May 17, 2005 by Bayindir Ertugrul

5.0 out of 5 stars The Best SQL Tuning book on the market
Having read most of the Oracle performance tuning books on the market, I have to say this is absolutely the best pure SQL tuning book you can buy. Read more
Published on August 17, 2004 by Ryan Gaffuri

5.0 out of 5 stars Great coverage, an essential reference
If you are a DBA or developer, working daily with databases that support SQL, you need this book. It covers in better detail than any other book I've seen, all the behind the... Read more
Published on June 11, 2004 by Douglas Rowe

4.0 out of 5 stars Think through your query and find a solid method.
I found this book helpful, and have started to use these techniques with success. I specifically was pleased that the techniques are portable across different Database vendors... Read more
Published on March 31, 2004 by David Rawheiser

5.0 out of 5 stars Practical, exhaustive text
Disclaimer: I am the CTO of youDevise Ltd., a firm that distributes a product of the author's former employer, TenFold Corporation. Read more
Published on March 20, 2004 by Douglas Squirrel

5.0 out of 5 stars A "Must Have" book for DBA's and SQL Developers
For many years the process of SQL Tuning has been considered an "art". SQL tuning books written to date have presented guidelines and "things to try" but... Read more
Published on February 27, 2004 by Brian H. Blades

Only search this product's reviews



Customer Discussions

 Beta (What's this?)
New! See all customer communities, and bookmark your communities to keep track of them.
This product's forum (0 discussions)
  Discussion Replies Latest Post
  No discussions yet

Ask questions, Share opinions, Gain insight
Start a new discussion
Topic:
First post:
Prompts for sign-in
  [Cancel]


Active discussions in related forums
   


Product Information from the Amapedia Community

Beta (What's this?)



Look for Similar Items by Category


Amazon MP3 Delivers Free Songs

Subscribe to The Amazon MP3 Download newsletter to find out about free song downloads, new releases and hot digital music deals first.
subscribe
 

Best Books of 2008

Best of 2008
Find our top 100 editors' picks as well as customers' favorites in dozens of categories in our Best Books of 2008 Store.
 

Up to 35% Off Casablanca Ceiling Fans

Shop for Casablanca ceiling fans
Feeling wilted by the summer heat? Get up to 35% off a premier Casablanca ceiling fan that'll help you cool down.

Shop all ceiling fans

 

Best Books

Best of the Month
See our editors' picks and more of the best new books on our Best of the Month page.
 
Ad

 

Feedback

If you need help or have a question for Customer Service, contact us.
 Would you like to update product info or give feedback on images?
Is there any other feedback you would like to provide?

Your comments can help make our site better for everyone.


Where's My Stuff?

Shipping & Returns

Need Help?

Your Recent History

  (What's this?)
You have no recently viewed items or searches.

After viewing product detail pages or search results, look here to find an easy way to navigate back to pages you are interested in.

Look to the right column to find helpful suggestions for your shopping session.

Continue shopping: Top Sellers
Free
Free by Chris Anderson
Paranoia
Paranoia by Joseph Finder
My Soul to Lose
My Soul to Lose by Rachel Vincent
Darkfever
Darkfever by Karen Marie Moning

Conditions of Use | Privacy Notice © 1996-2009, Amazon.com, Inc. or its affiliates