立即与支持人员聊天
与支持团队交流

SQL Optimizer for SQL Server 10.1.2 - User Guide

Welcome to SQL Optimizer Optimize SQL
Create Optimize SQL Sessions Open Optimize SQL Sessions Rewrite SQL Plan Control Use Temporary Tables
Optimize Indexes Find SQL Scan SQL Manage Plan Guides Configure Options Tutorials About Us

About SQL Optimization

During optimization, SQL Optimizer uses a unique Artificial Intelligence engine to execute SQL syntax rules that produce semantically equivalent SQL statement alternatives. The optimization process begins with SQL Optimizer generating alternatives from the original SQL statement. SQL Optimizer then rewrites each alternative to generate additional alternatives. This process continues until SQL Optimizer cannot generate additional alternatives or reaches a set of user-defined quotas. The result is a list of alternatives with unique SQL syntax that provides the same results as the original SQL statement.

Afterwards, SQL Optimizer applies SQL Server optimization hints to each alternative. This process continues until SQL Optimizer applies all the optimization hints to all alternatives or reaches a set of user-defined quotas. See Hints Options for more information.

A syntax transformation rule is illustrated in the following example:

SELECT *  

FROM table_a   

WHERE table_a.key   IN (SELECT table_b.key

  FROM table_b)                       

If table_b.key is an indexed column, the following transformation rule is applied:

SELECT *  

FROM table_a   

WHERE   EXISTS (SELECT 'x'

FROM table_b                  

WHERE table_b.key = table_a.key)                 

Although the previous two SQL statements produce the same result, SQL Server may use different execution plans to retrieve the data. The database structure, indexes, and data volume affect execution statistics. Therefore, you need to test the alternatives generated with your database environment in order to find the best alternative.

 

Related Topics

SQL Optimizer Tutorial

SQL Optimization Workflow

Create New Optimizer Sessions

Optimize SQL Statements

Auto Optimize SQL Statements

相关文档

The document was helpful.

选择评级

I easily found the information I needed.

选择评级