Upload_transparent

A Look under the Hood of CBO - the 10053 Event

 
 
 
 
 
mson77

by mson77

Value This
Doc
Scribd
Average
     
Pages: 19 43
Words: 9464 13640
Characters: 60168 81678
Lines: 587 623
     
     
Letters per word: 6.36 5.99
Words per line: 16.12 21.89
Words per page: 498.11 317.21

Add to your reading list

Flag_red Flag this document

Document Information

941 Reads | 0 Comments

Description

Have you ever been faced with a SQL statement where you know that if only Oracle would use an index it would perform so much better? Or not use an index, or use a different driving table, or use a hash join, or, or, or … If you are a DBA then this is a rhetorical question. Generally, it is just a matter of using the appropriate hint to solve the problem. However, increasingly DBAs are faced with SQL statements that are generated dynamically by applications, where the source is inaccessible, or which can not be changed because of licensing or support restrictions. This paper will shed some light on the decisions the cost based optimizer (CBO) makes when parsing a SQL statement and choosing an access plan. It will show how the CBO calculates the cost of a plan and some of the rules and factors that go into these calculations. By extrapolation, if you know how the CBO assigned the cost of a plan, you may be able to make changes that lead the optimizer to choose a different plan – without the need to make changes to the SQL statement. While you can not compare the costs of different explain plans, the optimizer does compare the costs of different plans, and chooses the one with the lowest cost, in its current parse tree! You just don’t see any of the plans which “lost out”. Unless you activate the 10053 event trace, that is. There you see all the access plans the CBO evaluated and the costs assigned to them. So, lastly, this paper will act as a guide should you decide to venture into the jungle of a 10053 event trace yourself.

Pdf_16x16 19 Pages


Date Added

09/16/2007

Category

Uncategorized.

Tags
Groups
Copyright

Attribution Non-commercial

More info »

 

or use Facebook Connect