Indexes and performance
Reading execution plans
Compare estimated and actual rows.
Understand the concept
An estimated plan shows proposed operators without execution. An actual plan adds runtime observations; its cost percentages remain model estimates rather than elapsed-time percentages. Executing a query still performs its writes and consumes resources.
Start with actual versus estimated rows, spill warnings, sorts, lookups and join points. Do not judge a plan by one icon. If many rows flow through operators to produce few results, inspect filters and grain. In SSMS, enable the actual plan with Ctrl+M, execute a SELECT and inspect the Execution Plan tab. This tiny dataset teaches reading, not production benchmarking.
Optimise based on evidence.
Reading estimated cost percentages as elapsed time.
One topic. Three levels of depth.
SELECT ProductName FROM lab.Product WHERE ProductId = 1;Inspect a simple key lookup query’s plan.
This page does not execute SQL. Practise in the downloadable SqlStudioLab using SSMS. Before rerunning temporary-table examples, remove only the relevant #table. Views, procedures and functions create persistent lab objects; never use a production connection.
Try it yourself first.
Inspect the actual plan for products sorted by price.
Show the solution and explanation
SELECT ProductId, ProductName, Price FROM lab.Product ORDER BY Price DESC, ProductId;Evaluate sorting against existing indexes. The browser does not execute this plan.