A query optimizer in SQL (Structured query language) is a database engine component that analyzes and improves the performance of SQL queries by choosing the most efficient execution plan.