AI engineering glossary · SQL databases
What is query optimizer?
Query optimizer (also called Query planner): The database component that considers different ways to run a query, such as join orders and index choices, estimates each one's cost using table statistics, and picks the cheapest. It is why the same SQL can run in different ways.
Query optimizer: an example
For a join of a huge table and a tiny filtered one, the optimiser starts from the tiny one and uses an index on the huge one.
Related terms
More SQL databases terms
- RANK and DENSE_RANK
- Recursive CTE
- Referential integrity
- Relational algebra
- Relational database
- Replication
- Row
- ROW_NUMBER
Where you learn it
Query optimizer is part of the AI Engineering Program, which teaches it with notes, a hands-on lab and an exam. The first lesson is free.