What is Cost-based optimization (CBO)?
A optimization strategy used by the query engine to pick a query plan to execute the SQL statement based on the cost estimate. It's the strategy used by all mainstream databases. It's predecessor is Rule-based optimization (RBO). The advantage of CBO is it's more adaptive than the hard-coded RBO since it's based on the actual context, the number of estimated rows to be fetched, the cost of each fetch, the index to be used and etc. Because there are quite a few factors to consider, and it's prohibitive expensive to explore all permutations, thus the database often finds the best plan among a subset of all possible plans.