Cost-Based Oracle Fundamentals
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 it’s doing something irrational. Too many people say, “It’s a bug” when they really mean “I don’t know why this happened”.
You will absolutely love this book. In it you will discover the how’s and why’s of the optimizer. Why statistics matter, how they matter. What’s 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 I’ll 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. I’ve used the (extremely poor) naming convention of “demo001.sql”, “demo002.sql” and so on. Next book – they’ll all have names and I’ll be referencing exactly like he did. Very nice.
The attention to detail, the simplicity of presentation (I don’t care what level of Oracle user you are – you will be able to read this book and get it). If you are ‘advanced’ (ok, I’ll put myself into that category), you’ll learn things you did not know before. If you are ‘beginner’, you’ll know lots more than some advanced people after reading it. The surprising thing? It isn’t that hard. Well, it wasn’t 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.
I’m on my second scan of it – re-reading things that I didn’t fully absorb. What I’ll 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 I’ll just post the link to the book.
And remember, this is “I” of “III”, two more to come…