top of page
Writer's pictureManoj Appully

Basic differences between a SQL Profile & SQL Baseline in Oracle

In the previous articles I have explained simple methods on how to interpret an AWR report, how to find an expensive SQL and how to tune an expensive SQL. One of the frequent confusions when you use Oracle's own tuning advisor is that of knowing what the difference is between a SQL Profile & SQL Baseline. I will explain it here. In Oracle a SQL Profile creates extra information about a particular SQL that the optimizer can use at run time to select the optimal plan to ensure best performance. In essence the SQL Profile enables dynamic behavior where the optimizer has multiple plans to choose from at run time based on run time bind variables etc. When you run the SQL Tuning Advisor for the list of recommendation you will see that the recommendation specifies whether a SQL can be improved by creating a SQL Profile or SQL Baseline. It is preferable to choose a SQL Profile simply because it allows the optimizer to pick best execution plans at run time. SQL Baseline on the other hand is more of a brute force method, when you simply marry a particular SQL to stay with a specific SQL execution plan. So no matter what the run time bind variables are for a given SQL, the optimizer will always try to use the SQL Baseline plan. This may work fine for most cases but instances where data skew is high it is preferable that one pick more efficient plans based on bind variable values passed at run time instead of always picking the same plan as generated by the SQL Baseline. In any case knowledge of the application data may make you prefer one over the other, in case you are clueless about this, then I would suggest you stick with the SQL Profile.

287 views0 comments

Recent Posts

See All

RAC and Index Contentions

If your application happens to be one where surrogate keys are used in abundance and if some of those tables are inserted/updated very...

Comentários


bottom of page