Chapter III.2. The SQL Server Optimizer

For speed and performance of any database management system, an optimizer identifies the best method to run queries. The best method includes identifying the best indexes to use and the most efficient methods of retrieving, joining, and sorting the data.

SQL Server uses its optimizer to evaluate and choose the best indexes and methods for individual queries. All queries are submitted to the optimizer, which in turn checks a variety of variables to create the best possible query plan. The query plan can be observed as text or in graphical mode by looking at the execution plan.

The most important thing you can do to support the optimizer is to ensure that statistics are automatically created and automatically maintained on all your indexes.

Get Microsoft® SQL Server™ 2008 All-In-One Desk Reference For Dummies® now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.