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.
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:
OPTIMIZER_MODE=RULE or CHOOSE—these modes now trigger deprecation warnings in the alert log./*+ RULE */ are obsolete and should be removed from SQL code.
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.
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:
FROM clause determined the driving table, influencing join order and performance.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:
RULE.DBMS_STATS.GATHER_SCHEMA_STATS.EXPLAIN PLAN or AUTOTRACE.Migrating from RBO to CBO not only improves performance and maintainability but also aligns legacy applications with current Oracle best practices and optimizer capabilities.
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.
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.