Hello, Tom.
SQL Plan Management sounds like a really good way to get optimizer to choose the right execution plans. (Actually, I expect Oracle to choose the right execution plan 99% of the time.) Anyway, the addition of the SQL Plan Management looks like Oracle has made a big step into one day having a fully-baked optimizer.
Performance Overhead:
-------------------------------
One of the biggest concerns is the performance overhead of using it. Should we all set optimizer_capture_sql_plan=true and optimizer_use_sql_plan=true by default? Will the performance improvements outweigh the performance overhead? I am pretty sure that you will say yes because the role that SPM plays, is what a mature optimizer should do.
Evolve:
---------
Regarding evolving a baseline, if the optimizer processes a SQL statement that has a sql plan baseline, is it possible for it to evolve that baseline if the value for optimizer_capture_sql_plan = false?
What if the value for optimizer_use_sql_plan = false, can it evolve it?
Fixed:
-----
Why is there even a ‘fixed’ option? Oracle states the following: “During the SQL plan baseline evolution phase, the database evaluates the performance of new plans and integrates plans with better performance into SQL plan baselines.”
Why would anyone want to prevent the optimizer from giving a SQL statement a better execution plan?
BTW: I am disappointed that the online documentation doesn’t have more information regarding this complex addition. Also, I wish that they made a bigger effort to implement this ‘SQL Plan Management’ as a ‘behind the scene’ optimizer task. The optimizer should just auto implement better plans for SQL statements. By putting this complex responsibility (capturing sql plan baselines, turning it on, evolve or fix execution plans) in the hands of DBAs, the applications will suffer unnecessarily.
You would use capture sql plan only during the period of time you are "happy" with plans. For example - before an upgrade.
The performance hit will only come during a hard parse - if you have a 'bad' system - that hard parses like mad - it will be large. If you have a well developed system with all soft parses (or even better - NO parses) it will be small.
Same with use sql plan - the hit is on the hard parse. If you don't hard parse, you don't have a hit. If you do, the hit is proportional to the amount of hard parsing you do.
That is, if you have a busted system that hard parses like mad, there isn't too much that will help you in general.
If you have a correctly developed system - it will have minimal performance impact at runtime parsing, and great benefit overall.
if you have use sql plan set to false, evolving doesn't have to happen, we'll just use it right away, you have disabled the feature basically.
Why would anyone want to prevent the optimizer from giving a SQL statement a better execution plan?
because in many cases, people prefer stability, consistency, predictability over
*everything* else. It is a choice.
what is missing from the documentation?
http://docs.oracle.com/cd/E11882_01/server.112/e16638/optplanmgmt.htm Have you left a detailed comment outlining what you think it missing there (bottom of page..) They read those and act on them...