Join Amazon Prime and ship Two-Day for free and Overnight for $3.99. Already a member? Sign in.
Cost-Based Oracle Fundamentals (v. 1) 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
50 used & new from $26.10

Have one to sell? Sell yours here
 
   
Cost-Based Oracle Fundamentals (Expert's Voice in Oracle) (v. 1)
 
 
Start reading Cost-Based Oracle Fundamentals (v. 1) on your Kindle in under a minute.

Don’t have a Kindle? Get yours here.
 
  

Cost-Based Oracle Fundamentals (Expert's Voice in Oracle) (v. 1) (Paperback)

by Jonathan Lewis (Author)
Key Phrases: filtered cardinality, final cardinality, code suite, Join Outer, Total Temp, Total Rows (more...)
4.6 out of 5 stars See all reviews (27 customer reviews)

List Price: $49.99
Price: $40.45 & this item ships for FREE with Super Saver Shipping. Details
You Save: $9.54 (19%)
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 Monday, July 20? Choose One-Day Shipping at checkout. Details
33 new from $27.97 17 used from $26.10
Also Available in: List Price: Our Price: Other Offers:
Kindle Edition (Kindle Book) $36.18

Frequently Bought Together

Cost-Based Oracle Fundamentals (Expert's Voice in Oracle) (v. 1) + Expert Oracle Database Architecture: 9i and 10g Programming Techniques and Solutions + Effective Oracle by Design (Osborne ORACLE Press Series)
Price For All Three: $109.73

Show availability and shipping details


Customers Who Bought This Item Also Bought

Effective Oracle by Design (Osborne ORACLE Press Series)

Effective Oracle by Design (Osborne ORACLE Press Series)

by Thomas Kyte
4.9 out of 5 stars (27)  $37.79
Oracle Database 10g Performance Tuning Tips & Techniques (Osborne ORACLE Press Series)

Oracle Database 10g Performance Tuning Tips & Techniques (Osborne ORACLE Press Series)

by Richard Niemiec
4.9 out of 5 stars (15)  $37.79
Oracle Wait Interface: A Practical Guide to Performance Diagnostics & Tuning (Osborne ORACLE Press Series)

Oracle Wait Interface: A Practical Guide to Performance Diagnostics & Tuning (Osborne ORACLE Press Series)

by Richmond Shee
5.0 out of 5 stars (34)  $34.55
Troubleshooting Oracle Performance

Troubleshooting Oracle Performance

by Christian Antognini
4.4 out of 5 stars (5)  $53.99
Optimizing Oracle Performance

Optimizing Oracle Performance

by Cary Millsap
4.7 out of 5 stars (27)  $25.51
Explore similar items


Editorial Reviews

Product Description
The insights that Jonathan provides into the workings of the cost-based optimizer will make a DBA a better designer, and a Developer a better SQL coder. Both groups will become better troubleshooters</a></p> </blockquote> <p id="quoteAuthor">&#8212; Thomas Kyte, VP (Public Sector), Oracle Corporation</p></div>

<p>The question, "Why isn't Oracle using my index?" must be one of the most popular (or perhaps unpopular) questions ever asked on the Oracle help forums. You've picked exactly the right columns, you've got them in the ideal order, you've computed statistics, you've checked for null columns&emdash;and the optimizer flatly refuses to use your index unless you hint it. What could possibly be going wrong?</p>

<p>If you've suffered the frustration of watching the optimizer do something completely bizarre when the best execution plan is totally obvious, or spent hours or days trying to make the optimizer do what you want it to do, then this is the book you need. You'll come to know how the optimizer "thinks," understand why it makes mistakes, and recognize the data patterns that make it go awry. With this information at your fingertips, you will save an enormous amount of time on designing and trouble-shooting your SQL.</p>

<p>The cost-based optimizer is simply a piece of code that contains a model of how Oracle databases work. By applying this model to the statistics about your data, the optimizer tries to efficiently convert your query into an executable plan. Unfortunately, the model can't be perfect, your statistics can't be perfect, and the resulting execution plan may be far from perfect.</p>

<p>In <i>Cost-Based Oracle Fundamentals</i>, the first book in a series of three, Jonathan Lewis&emdash;one of the foremost authorities in this field&emdash;describes the most commonly used parts of the model, what the optimizer does with your statistics, and why things go wrong. With this information, you'll be in a position to fix entire problem areas, not just single SQL statements, by adjusting the model or creating more truthful statistics.</p>

About the Author
Jonathan Lewis has been involved in database work for more than 19 years, specializing in Oracle for the last 16 years and working as a consultant for the last 12 years. Jonathan is currently a director of the UK Oracle User Group (UKOUG) and is well known for his many presentations at the UKOUG conferences and SIGs. He is also renowned for his tutorials and seminars about the Oracle database engine, which he has held in various countries around the world.

<p>Jonathan authored the acclaimed book <i>Practical Oracle 8i</i> (Addison-Wesley, 2001), and he writes regularly for the UKOUG magazine and occasionally for other publications, including <i>OTN</i> and <i>DBAZine</i>.


Product Details

  • Paperback: 536 pages
  • Publisher: Apress; 1 edition (May 4, 2009)
  • Language: English
  • ISBN-10: 1590596366
  • ISBN-13: 978-1590596364
  • Product Dimensions: 9.1 x 7 x 1.1 inches
  • Shipping Weight: 1.8 pounds (View shipping rates and policies)
  • Average Customer Review: 4.6 out of 5 stars See all reviews (27 customer reviews)
  • Amazon.com Sales Rank: #335,206 in Books (See Bestsellers in Books)

Inside This Book (learn more)

What Do Customers Ultimately Buy After Viewing This Item?


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)
(2)
(1)

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?

Sell a Digital Version of This Book in the Kindle Store

If you are a publisher or author and hold the digital rights to a book, you can sell a digital version of it in our Kindle Store. Learn more

 

Customer Reviews

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

 
51 of 53 people found the following review helpful:
5.0 out of 5 stars If you have ever wanted to understand what Oracle is doing..., November 21, 2005
This is the book for you.

This book is, well, in a word amazing. If you have ever been baffled or bemused by why the heck did the optimizer do that, or as Jonathan wrote on page 299:

"I am reluctant to call something a bug unless I can work out what Oracle is doing and can prove that its doing something irrational. Too many people say, Its a bug when they really mean I dont know why this happened."

You will absolutely love this book. In it you will discover the hows and whys of the optimizer. Why statistics matter, how they matter. Whats up with histograms when and where do we need them, what affect do they have.

Sprinkled throughout the book are random insights like this one:

"There are many ways to implement Oracle systems badly, and as a general rule, anything that hides useful information from the optimizer is a bad idea. One of the simple, and highly popular, strategies for doing this is to stick all of your reference data into a single table with a type column. The results can be catastrophic as far as the optimizer is concerned."

And then is goes on to say why. That is what I really really like it goes on to say why. I hate it when statements are made and no reasoning is made why. You will find none of that in this book.

Jonathan did one thing in this book that Ill definitely be stealing myself. One neat thing is every chapter ends with a list of script names and descriptions. In the text, he references these script names as well. That way, when you download the code you have a straight reference to the sample you should be running. Ive used the (extremely poor) naming convention of demo001.sql, demo002.sql and so on. Next book theyll all have names and Ill be referencing exactly like he did. Very nice.

The attention to detail, the simplicity of presentation (I dont care what level of Oracle user you are you will be able to read this book and get it). If you are advanced (ok, Ill put myself into that category), youll learn things you did not know before. If you are beginner, youll know lots more than some advanced people after reading it. The surprising thing? It isnt that hard. Well, it wasnt to me anyway maybe the math background I have helped. You do not need 10 years of experience with Oracle to get this stuff, and if you have 10 years of experience with Oracle you will get new knowledge you never had.

Im on my second scan of it re-reading things that I didnt fully absorb. What Ill be doing lots in the future is referring to it. I got the gist of everything, I know where to go when I need to explain why. Or maybe Ill just post the link to the book.

And remember, this is I of III, two more to come
Comment Comment | Permalink | Was this review helpful to you? Yes No (Report this)



 
12 of 13 people found the following review helpful:
5.0 out of 5 stars The Real Cost of Oracle, December 28, 2005
The beauty of reading a book by a publisher not sanctioned by Oracle and by an author who doesn't work for Oracle is that they can openly mention bugs. And there are oh-so-many! This book is a superb introduction to the Cost Based Optimizer, and is not afraid to discuss it's many shortcomings. In so doing it also explains how to patch up those shortcomings by giving the CBO more information, either by creating a histogram here and there, or by using the DBMS_STATS package to insert your own statistics in those specific cases where you need to.

Another interesting thing is how this book illustrates, though
accidentally, the challenges of proprietary software systems. Much of this book and the authors time is spent reverse engineering the CBO, Oracle's bread and butter optimizing engine. Source code, and details about its inner workings are not published or available. And of course that's intentional. But what's clear page after page in this book is that for the DBA and system tuner, going about their day to day tasks, they really need inside information about what the optimizer is doing, and so this book goes on a long journal to illuminate much of what the CBO is doing, or in some cases provide very educated guesses and some speculation. In contrast, as we know and hear about often, the Open Source alternative provides free access to source code, though not necessarily to the goods themselves. What this means in a very real way is that a book like this would not need to be written for an alternative open source application, because the internal code would be a proverbial open book. That said it remains difficult to imagine how a company like Oracle might persue a more open strategy given that their bread and butter really is the secrets hidden inside their Cost Based Optimizing engine. At any rate, let's get back to Jonathan's book.

Reading this book was like reading a scientists notebook. I found it:
o of inestimable value, but sometimes difficult to sift through
o very anecdotal in nature, debugging, and constantly demonstrating that the CBO is much more faulty and prone to errors than you might imagine
o may not be easy to say I have a query of type X, and it is behaving funny, how do I lookup information on this?
o his discussion of the evolution of the product is so good I'll quote it:
"A common evolutionary path in the optimizer code seems to be the following: hidden by undocumented parameter and disabled in first release; silently enabled but not costed in second release; enabled and costed in third release."
o has excellent chapter summaries which were particularly good for sifting, and boiling down the previous pages into a few conclusions.
o it will probably be of particular value to Oracle's own CBO development teams

Some chapter highlights
-------------------

CH2 - Tablescans
explains how to gather system stats, how to use dbms_stats to set ind. stats manually, bind variables can make the CBO blind, bind variable peeking may not help, partition exchange may break global stats for table, use CPU costing when possible

CH3 - Selectivity
big problem with IN lists in 8i, fixed in 9i/10g, but still prob. with NOT IN, uses very good example of astrological signs overlapping birth months, and associated CBO cardinality problems, reminds us that the optimizer isn't actually intelligent per se, but merely a piece of software

CH4 BTree Access
cost based on depth, #leaf blocks, and clustering factor, try to use CPU costing (system statistics)

CH5 - Clustering Factor
mainly a measure of the degree of random distribution of your data, very important for costing indx scans, use dbms_stats to correct when necessary, just giving CBO better information, freelists (procID problem) + freelist groups discussion with RAC

CH6 - Selectivity Issues
there is a big problem with string selectivity, Oracle uses only first seven characters, will be even more trouble for urls all starting with "http://", and multibyte charactersets, trouble when you have db ind. apps which use string for date, use histrograms when you have problems, can use the tuning advisor for "offline optimization", Oracle uses transitive closure to transform queries to more easily opt versions, moves predicates around, sometimes runs astray

CH7 - Histograms
height balanced > 255 buckets (outside Oracle called equi-depth),
otherwise frequency histograms, don't use cursor sharing as it forces bind variables, blinds CBO, bind var peeking is only first call, Oracle doesn't use histograms much, expensive to create, use sparingly, dist queries don't pull hist from remote site, don't work well with joins, no impact if you're using bind vars, if using dbms_stats to hack certain stats be careful of rare codepaths

CH8 - Bitmap Indexes
don't stop at just one, avoid updates like the plague as can cause deadlocking, opt assumes 80% data tightly packed, 20% widely scattered

CH9 - Query Transformation
partly rule based, peeling the onion w views to understand complex queries, natural language queries often not the most efficient, therefore this transformation process has huge potential upside for Oracle in overall optimization of app code behind the scenes by db engine, always remember Oracle may rewrite your query, sometimes want to block with hints, tell CBO about uniqueness, not NULL if you know this

CH10 - Join Cardinality
makes sensible guess at best first table, continues from there,
don't hide useful information from the CBO, histograms may help with some difficult queries

CH11 - Nested Loops
fairly straightforward costing based on cardinality of each returned set multiplied together

CH12 - Hash Joins
Oracle executes as optimal (all in memory), onepass (doesn't quite fit so dumped to disk for one pass) and multipass (least attractive sort to disk), avoid scripts writing scripts in prod, best option is to use workarea_size_policy=AUTO, set pga_aggregate_target & use CPU costing

CH 13 - Sorting + Merge Joins
also uses optimal, onepass, & multipass algorithms, need more than 4x dataset size for in memory sort, 8x on 64bit system, increasing sort_area_size will incr. CPU util so on CPU bottlenecked machines sorting to disk (onepass) may improve performance, must always use ORDER BY to guarentee sorted output, Oracle may not need to sort behind the scenes, Oracle very good at avoiding sorts, again try to use workarea_size_policy=AUTO

CH 14 - 10053 Trace
reviews various ways to enable, detailed rundown of trace with comments inline, and highlights; even mentions a VOL 2 + 3 of the book is coming!

Appendix A
be careful when switching from analyze to dbms_stats, in 10g some new hist will appear w/default dbms_stats options, 10g creates job to gather stats

Conclusion
----------
I found this book to be full of gems of information that you won't find anywhere else. If you're at the more technical end of the spectrum, this is a one of a kind Oracle book and a
must-have for your collection. Keep in mind something Jonathan mentions in appendix A: "New features that improve 99% of all known queries may cripple your database because you fall into the remaining 1% of special cases". If these cases are your concern, then this book will surely prove to be one-of-a-kind for you!
Comment Comment | Permalink | Was this review helpful to you? Yes No (Report this)



 
8 of 8 people found the following review helpful:
5.0 out of 5 stars No Competition, December 2, 2005
By V. Tropashko (Foster City, CA) - See all my reviews
(REAL NAME)   
There is little point to write how good this book is, since there is no other book devoted to SQL optimization exclusively. Dan Tow's book comes close, but he is focused more on a method of join graph analysis that he developed, than on details how optimizer did arrive to a certain access path. The lack of competition on the market is really surprising giving that SQL optimization is the only part of RDBMS that is justifiably complex, and would remain complex in foreseable future.

Compared to SQL optimizations all the other issues that DBA deals today look ridiculous. There is no reason why, for example export and import should be more complex than copying image file from your camera. Likewise, managing extents and segments is totally automated these days. All the manageability trend just proves a simple idea that RDBMS is nothing more than query execution engine.

Now, unlike any other RDBMS implementation area, the flow of poorly executed SQL never seems to cease. SQL Optimization is well known to be a difficult problem. Statistics information is incomplete, robust cost metrics is elusive, and the search space is explosive. The optimization goals are often conflicting. The very first idea that every SQL performance analyst discovers: "The optimization is only as good as its cost estimates". Those issues are fundamental rather than SQL DBMS vendor specific, of course. Given the scope and complexity of the problem, one citation comes to mind: "There is no emperor's way to SQL optimization".
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 A Fantastic Book with a Very Deceptive Name
I waited nearly three years after the first cover to cover read through of this book, and two years after the second cover to cover read through of this book to write this review... Read more
Published 5 months ago by Charles Hooper

5.0 out of 5 stars A Classic
Well, you can read this and update with new features for 10g and 11g. Or you can read 1200, maybe 1500 pages of documentation and try to tie everything together. Read more
Published 6 months ago by S. Greenlaw

5.0 out of 5 stars Great Book!
This book contains a wealth of information about how to evaluate and test the Oracle Cost Based Optimizer. Jonathan presents the material in a very easy to follow style. Read more
Published 10 months ago by Roger C. Carlson

5.0 out of 5 stars Invaluable Oracle Resource
Jonathan Lewis has perfomed an invaluable service to the Oracle community. He doesn't just offer opinions of how the CBO makes decisions from his vast experience. Read more
Published 12 months ago by Dennis W. Willaims

3.0 out of 5 stars I was disappointed
It doesn't mean you won't love the book. I found it to be far too narrow and, even as an Oracle OCP, boringly written. Read more
Published 20 months ago by Michael Milligan

5.0 out of 5 stars Jonathan is a tease... but it's a great book!
Each quarter my team of DBA's has one book that we read and discuss in team meetings. This quarter, Cost-Based Oracle Fundamentals is it. Read more
Published 23 months ago by Robert G. Freeman

5.0 out of 5 stars Invaluable Knowledge and Applicability
This book gets a prized spot on my technical shelf. It is a challenging read, and has taken the most time of any book I have to get through, but it is quite good. Read more
Published on November 27, 2006 by Laine Campbell

5.0 out of 5 stars Another brilliant book by Jonathan Lewis
This is the book that one definitely needs to read (and understand) in order to get an idea what the CBO is all about. Read more
Published on October 17, 2006 by Krishnendu Deb

5.0 out of 5 stars Excellent Book! Recommended!
I bought the book "Cost-Based Oracle Fundamentals" and I found it extremely helpful and I've been recommending to other people - both DBA's and SQL writers. Read more
Published on September 13, 2006 by J. Keyser

2.0 out of 5 stars How much of it is useful ???
I took two days and went through the book. Sounds more like
R&D book rather than something which I am going to use. Read more
Published on July 7, 2006 by BK

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]

   


Product Information from the Amapedia Community

Beta (What's this?)


So You'd Like to...


Look for Similar Items by Category


Bath Wonders from LUSH

LUSH bath bombs
Find bath bombs, bath melts, shower jellies, and more great gifts for yourself (or a friend!) from LUSH Fresh Handmade Cosmetics.

Shop LUSH now

 

Big Savings in Books

Bargain Books
Find great titles at fantastic prices in our Bargain Books Store.
 

Buy Three Books, Get a Fourth Free

4-for-3 Books
Order any four eligible books under $10 and get the lowest-price book free in our 4-for-3 Books Store. See more details.
 

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
Glenn Beck's Common Sense

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