Synopses & Reviews
Synopsis
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?and the optimizer flatly refuses to use your index unless you hint it. What could possibly be going wrong?
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.
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.
In Cost-Based Oracle Fundamentals, the first book in a series of three, Jonathan Lewis? one of the foremost authorities in this field?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.
Synopsis
Arthur C. Clarke once wrote that any sufficiently advanced technology is indistinguishable from magic. I believe that observation to be entirely accurate. Someone else later observed that any technologist with sufficient knowledge is indistinguishable from a magician. With that in mind, what you have in your hands right now is a book on magic. However, for as long as I ve known the author of this book, Jonathan Lewis (some 11 years according to my research on Google going back over the newsgroup archives), he has never been content to accept magic. He wants to know why something happens the way it does. So, fundamentally, his book is all about understanding: understand v. understood, (-std) understanding, understands 1. To perceive and comprehend the nature and significance of 2. To know thoroughly by close contact or long experience with More precisely, it is all about understanding the Oracle cost based optimizer (CBO), how it works, and why it does what it does. Jonathan conveys to us his understanding of the Oracle CBO through practice and example, and with this understanding, with this knowledge, new options and solutions become available. Put simply, the Oracle CBO is a mathematical model; you feed it inputs (queries, statistics), and it produces outputs (query plans). In order to use the CBO successfully, it is critical that you understand what these inputs are and how the CBO uses them."
Synopsis
In this book, volume 1 in a series of three, Jonathan covers the fundamentals: the things that everyone who uses the Oracle database needs to know about the CBO. It sheds light on the decisions the CBO makes when parsing a SQL statement and choosing an access plan. It demonstrates how the CBO calculates the cost of a plan and the rules and factors that go into these calculations. It reveals the basic assumptions the optimizer makes about the SQL and the data, explains why things go wrong and how you can fix them when those assumptions are incomplete, inaccurate, or simply false. He also includes a fabulous Upgrade Headaches section that is essential reading for anyone who has ever has, or ever will, upgrade between Oracle versions. Volumes 2 and 3 will track changes to the CBO in subsequent Oracle 10g releases, and will cover the more advanced and complex features of optimization.