The query optimizer is a component of database management system that is used to analyzes queries submitted to SQL Server for execution, and then determines the optimal way to execute the query. The query optimizer cannot be accessed directly by users. Instead, once queries are submitted to SQL Server, and parsed by the parser, the parser passes the queries to the query optimizer where optimization occurs.