The Oracle Optimizer generates execution plans by evaluating the predicates specified in the WHERE clause of a SQL statement and by using object statistics (such as table, column, and index statistics) stored in the data dictionary to estimate cardinality and cost. Additionally, through adaptive query optimization introduced in Oracle Database 12c, the optimizer can detect at runtime or after execution that a chosen plan was suboptimal and can re-optimize subsequent executions of the same statement using mechanisms like cardinality feedback and SQL Plan Directives, improving future plan choices without manual intervention.
Community Discussion