Wednesday, March 25, 2009

Oracle Cost Base Optimizer - getting sucked in

This Blog on the CBO, from the very Team at Oracle, gets a Hughe thumbs up from me!
The CBO is Truly Brilliant.
Oh Yes, it is.

Rant ?
me Rant ?
Never. I dont waste engergy that way.
Mind you, CBO is a worthy adversery when it comes to wasting energy. Especially after upgrades to 10g [link?].

Very Clever, the CBO.
The CBO will get it "mostly right in most of the cases" (famous quotation needed, but it is true). However those few cases where the CBO gets it wrong can really ruin your reputation.

I would always maintain that we paid Oracle to do the hard work for us, and I would not get sucked into doing arcane bespoke stuff with stats and hints and outlines and whatever to make a query do the bleeding obvious. Meanwhile, I spent hours tweaking all of the above, and reading near-scientific stuff trying to understand CBO just a bit better still. And now I finally got sucked in: I will join the ranks of those who have ranted presented on the CBO...

I must be careful here: Nobody ever got praised for pokeing fun at large vendors. The Real Application CBO is like those other Real Application Thingies: Oracle is Soooo Proud of it. No other database-vendor even comes close in ingenuity, in sheer intelligence, and in cunning engineering where query optimization is concerned.
So yes, I admit it, the CBO is Brilliant.
If it gets it right.

I did it again today:
A customer-meeting got sidetracked into "performance" and I spent 20 min explaining that when CBO made some seemingly inefficient decisions, it was not the CBO at fault. CBO tries as best it can. CBO will be using spfile-parameters, system-stats, object-stats, histograms, session-parameters, where-clauses, hints, outlines, and sql-plans and whatever other information it can glean from looking at the stars or tealeaves or whatever. So, if it is not the CBO at fault, it must be us, right ? We should have read the manual, the whitepapers, metalink, and followed the instructions available.

OK, real reason for this post: a plug for OUG Scotland.

I still need to write the abstract and the ppt, and wanted to aim it more towards efficient indexing, refer to Tapio and Richard Foote. Show CBO the obvious route (you can lead a clever horse to water) and it might just get it right... But my ppt will probably involve "how I fought the CBO".
Thomas already put up the title as a CBO related item...

These guys and many other good writers have basically said all there is to say already. And I am not qualified to tell you much on gathering stats or how to tweak parameters. Nor can I teach you about high-tech-hinting[link needed]. Others have done that before me, and did a much better job then I could hope to do.

I was hoping to offer some silver bullits, but even those tend not to work with the CBO. A Hammer is the next best simple-sophisticated tool I can think of...I know my limitations.

I am going to take as Simple an approach as I can.

No comments:


This is the footer...and this should be small text for disclaimers and the like. and some small stuff

Locations of visitors to this page And this text is placed next to the map. we could possibly hide some stuff here too for the benefit of the search-engines and if it is at color ffffff cam we put all sort of rubbish that we do not want readers to see. travel itinirary reservation ticket agent flight plane boarding attendant train connection rail ticket wait time booking flight boardingtime taxi ramp luggage suitcase trolley wheely laptop bagpack corpaorate wifi connection oracle. it will also be interesting to see what happens when this wrap around. or even if we put in spherus and worwood as additional word.