Views, indexes, and query performance
Read an execution plan
Use a real query to identify access, join, and row-estimate decisions in its plan.
Lesson 74 of 84
Reading: about 2 min
Lesson + practice: about 15 min
Difficulty: Advanced
On this page4 sections
This lesson uses DDI_SQL_Training dataset v1.0.0 on SQL Server 2019 or later. Use a real query to identify access, join, and row-estimate decisions in its plan.
Run the example
SELECT TOP (3) o.OrderID, c.FirstName
FROM dbo.Orders AS o
JOIN dbo.Customers AS c ON c.CustomerID = o.CustomerID
WHERE o.OrderID BETWEEN 1 AND 100
ORDER BY o.OrderID;Read it step by step
- Run the query with Actual Execution Plan enabled in a SQL Server editor.
- Read operators from data access through join and any sort or TOP; compare estimated and actual rows at each operator.
- This page shows the verified result rows, not an invented fixed plan: the plan can differ by version, statistics, and settings.
Check the result
| OrderID | FirstName |
|---|---|
| 1 | Alex |
| 2 | Maya |
| 3 | Leo |
On the unmodified dataset, these are the first three matching orders by OrderID.
Practice
Run a similar query for OrderID 101–200 and inspect its actual plan.
Check your answer and expected result
Reveal answer
SELECT TOP (3) o.OrderID, c.FirstName
FROM dbo.Orders AS o
JOIN dbo.Customers AS c ON c.CustomerID = o.CustomerID
WHERE o.OrderID BETWEEN 101 AND 200
ORDER BY o.OrderID;| OrderID | FirstName |
|---|---|
| 101 | Alex |
| 102 | Maya |
| 103 | Leo |
Compare actual and estimated rows in your editor; operator choices can vary even when result values are fixed.
Your progress
Reveal the check answer or reach the end to complete this lesson.