Rule Based Optimizer   «Prev  Next»

Lesson 9

Rule-Based Optimizer: Historical Context and Modern Alternatives

The Rule-Based Optimizer (RBO) once served as Oracle’s primary query optimization engine, relying on a fixed set of heuristics to determine execution plans. While it provided predictable behavior in early Oracle versions, it is now fully deprecated. Modern Oracle releases rely exclusively on the Cost-Based Optimizer (CBO), which evaluates real-time statistics to determine the most efficient access path for SQL queries.

End of Support for Rule-Based Optimization

RBO was formally deprecated in Oracle Database 10g Release 1 (10.1). No bug fixes, enhancements, or performance improvements have been provided since its removal. Oracle now supports only the cost-based optimizer, which uses object statistics, system resources, and query patterns to determine optimal execution plans dynamically.
The following parameters and modes are no longer supported:

Oracle recommends gathering accurate object statistics using the DBMS_STATS package and letting the cost-based optimizer choose the execution plan automatically. This approach ensures that the optimizer can adapt to workload and data distribution changes in real time.

RBO Characteristics and Limitations

Although RBO served its purpose in early Oracle environments, it was rigid and often produced inefficient execution plans for complex queries. Below is a summary of its key behaviors:

  1. Heuristic-based decision-making: RBO used a fixed set of ranking rules for access paths, ignoring data statistics.
  2. Index selection issues: It often chose suboptimal indexes, requiring developers to use hints or reorder clauses to achieve better performance.
  3. Order sensitivity: The sequence of tables in the FROM clause determined the driving table, influencing join order and performance.
  4. Manual tuning overhead: DBAs and developers frequently needed to rewrite SQL or disable indexes to force desirable access paths.
  5. Lack of adaptability: RBO did not respond to data growth, skewed distributions, or changing workloads.

Migration from RBO to CBO

Modern Oracle databases rely exclusively on the Cost-Based Optimizer (CBO), which uses statistics to estimate the cost of various execution plans. Migrating legacy RBO code involves:

Migrating from RBO to CBO not only improves performance and maintainability but also aligns legacy applications with current Oracle best practices and optimizer capabilities.

Key Terms

Modern Recommendation

All SQL tuning and execution plan management should now rely on the Cost-Based Optimizer. DBAs should ensure that object statistics are current and use query plan baselines, adaptive optimization, and histograms to fine-tune performance instead of static rule-based behavior.

Next Steps

In the next module, we will explore Cost-Based Optimization and demonstrate how statistical analysis drives execution plan selection. A hands-on quiz is also available to reinforce these concepts.

Rule Based Optimizer - Quiz

Before you go on, click the Quiz link below to see how well you understand some of the concepts from this module.
Rule Based Optimizer - Quiz

SEMrush Software 9 SEMrush Banner 9