Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

A table, Customers, exists in SQL Server 2012. It has no Indexes.

Image Removed

Image Added

1. Table Structure

Before Tuning - Query Execution Plan

Image Removed

Image Added

Image Removed

Image Added

Image Removed

Image Added

2. Query with a simple WHERE clause3. Query Cost displayed in an
Execution Plan
4. Table Scan in a Visual Explain
Diagram

From Aqua Data Studio's Visual Explain Tool, you can find out that the Optimizer uses a full table scan while the query

...

After Tuning - Introducing an Index

Image Removed

Image Added

Image Removed

Image Added

Image Removed

Image Added

5. CREATE UNIQUE INDEX statement
executed
6. Reduced query Cost displayed
in an Execution Plan
7. Index Scan in a Visual Explain
Diagram

Table scan versus index scan

...