CockroachDB Glossary

Cost-Based Optimizer

Note: This term is specific to CockroachDB, a Distributed SQL database. In other contexts, it may be used differently.

What is a cost-based optimizer?

The Cost-Based Optimizer is a feature of CockroachDB that looks at all possible ways in which a query can be executed and assigns each a “cost” that indicates how efficiently the query can be run. Then the optimizer chooses the way that has the lowest cost, and is therefore most efficient. This feature only works with databases that speak SQL, so it’s an added benefit obtained from having a SQL layer.