Before a Transact-SQL query, batch, stored procedure, trigger, prepared statement, or dynamic SQL statement begins execution on an instance of Microsoft SQL Server, it is compiled into a query plan by the SQL Server Database Engine query optimizer. Then the plan is executed to produce a result-set. The compiled query plans are stored into a part of SQL Server memory that is called the plan cache. Query performance can be analyzed to improve it by viewing query execution plans or by manipulating the way cached query plans are used by applications. The topics in this section contain information about how you can view and manipulate SQL Server Database Engine query plans to improve query performance.
- Query Tuning
Contains information about how to use the Showplan feature of the SQL Server Database Engine to view and analyze query plans.
- Optimizing Queries in Deployed Applications by Using Plan Guides
Contains information about using the sp_create_plan_guide system stored procedure to optimize query performance when changing the text of the query is not possible.
- Specifying Query Plans with Plan Forcing
Contains information about using the USE PLAN query hint to force the query optimizer to use a specific query plan for a query.
- Optimizing Queries That Access Correlated datetime Columns
Contains information about using the DATE_CORRELATION_OPTIMIZATION database SET option to improve query performance for queries that perform an equi-join between two tables whose datetime columns are correlated.