SQL BASELINES

posted Jan 28, 2012, 12:54 PM by Sachchida Ojha
SQL BASELINES WERE INTRODUCED in ORACLE 11G AND ARE INTENDED TO SUPPLEMENT SQL PROFILES AND EVENTUALLY REPLACE STORED OUTLINES.
SQL profile collect statistics from a specific SQL execution and creates statistical information that helps the optimizer make better decisions. This makes the optimizer more flexible, which is definitely an advantage, especially in environments where ad-hoc SQL is common or where data volumes are fluid.

This flexibility is all very well, but we we actually want is flexibility and stability. We don't mind if optimizer pick a new plan if circumstances change, providing that plan is always for the better.


BASELINES provide a mechanism that enables plans to change, but only after they are proven to be better than any existing plans. BASELINE attempt to provide a best-of-both-worlds solution offering both optimizer flexibility and stability.

We can use DBMS_SPM package to create BASELINE.



Comments