The internal database component that determines the most efficient way to actually execute a SQL statement and builds its execution plan.
Since the same SQL query could be executed in multiple ways (different join orders, whether to use an index, etc.) while returning the same result, the optimizer automatically picks the method estimated to have the lowest cost based on table statistics. If those statistics are out of date, an inefficient execution plan can end up being chosen.
© 2026 ITBGM