Sitemap
Stackademic

Stackademic is a learning hub for programmers, devs, coders, and engineers. Our goal is to democratize free coding education for the world.

Reading SQL Server Execution Plans Without Getting Lost

5 min readJul 13, 2026

--

Press enter or click to view image in full size

Every SQL Server developer eventually reaches the same point: a query that always worked suddenly becomes slow.

The first recommendation is almost always:

“Check the execution plan.”

So you open the graphical plan…

There are arrows.

There are dozens of operators.

There are percentages everywhere.

And after staring at it for five minutes, you close it without understanding what happened.

The good news is that execution plans are much simpler than they initially appear. You don’t need to memorize every operator to identify performance problems. You only need to know where to look.

Let’s explore the parts of an execution plan that actually matter.

What Is an Execution Plan?

An execution plan is SQL Server’s roadmap for executing your query.

Instead of reading your SQL statement line by line, the optimizer transforms it into a series of physical operations.

For example:

SELECT
ProductId,
ProductName
FROM Products
WHERE CategoryId = 5;

SQL Server may decide to:

  1. Read an index.
  2. Filter matching rows.
  3. Return the result.

Or…

It may decide to scan the entire table if no useful index exists.

The execution plan simply shows the path chosen by the optimizer.

Read From Right to Left

One of the biggest mistakes beginners make is reading execution plans from left to right.

Execution plans actually execute from right to left.

Index Seek
↓
Nested Loops
↓
Sort
↓
SELECT

The operators on the right produce data.

Each operator passes rows to the next one until the SELECT operator returns the final result.

Once you understand this flow, execution plans become much easier to follow.

The Thickness of the Arrows Matters

Many people focus only on the operator icons.

Experienced SQL Server professionals usually look at the arrows first.

Why?

Because arrow thickness represents the number of rows flowing between operators.

Thin arrow

────►

Few rows.

Thick arrow

════════════►

Many rows.

If a query processes millions of rows before filtering them down to ten, you’ve probably found a performance problem.

The Most Common Operators

You don’t need to know every operator.

Learning these few covers the majority of execution plans.

Index Seek ✅

This is generally what you want.

SQL Server navigates directly to the required rows.

Index Seek

Fast.

Efficient.

Minimal reads.

Index Scan

SQL Server reads the entire index.

Sometimes this is perfectly acceptable.

Sometimes it’s a sign that an index isn’t selective enough.

Index Scan

Not always bad — but worth investigating.

Table Scan

SQL Server reads every row in the table.

Table Scan

On a small lookup table?

No problem.

On a table with 200 million rows?

Definitely a problem.

Key Lookup

This operator surprises many developers.

SQL Server first finds matching rows using a nonclustered index…

…then goes back to the clustered index to retrieve additional columns.

Index Seek
↓
Key Lookup

Occasional lookups are fine.

Thousands of lookups usually indicate a missing covering index.

Sort

Sorting requires CPU and memory.

Sort

Large sorts can become expensive, especially when SQL Server spills data to TempDB.

Sometimes creating an index in the correct order eliminates the need for sorting entirely.

Hash Match

Hash Match often appears during joins and aggregations.

Hash Match

It isn’t inherently bad.

Get Bruno Destro’s stories in your inbox

Join Medium for free to get updates from this writer.

In fact, SQL Server frequently chooses it because it’s the fastest option for large datasets.

The key is understanding why it was selected.

Estimated vs Actual Execution Plans

SQL Server provides two different execution plans.

1. Estimated Plan

Shows what SQL Server expects to happen.

No query execution required.

Useful for analyzing queries safely.

2. Actual Plan

Shows what actually happened.

Includes:

  • Actual row counts
  • Actual execution statistics
  • Memory usage
  • Runtime warnings

When troubleshooting performance issues, the Actual Execution Plan usually provides far more valuable information.

Estimated Rows vs Actual Rows

This is one of the most important things to check.

Imagine SQL Server estimates:

Estimated Rows = 100

But actually processes:

Actual Rows = 5.000.000

That’s a huge estimation error.

Poor cardinality estimates often lead SQL Server to choose inefficient operators.

Common causes include:

  • Outdated statistics
  • Parameter sniffing
  • Skewed data distribution
  • Poor predicates

Large differences between estimated and actual rows deserve immediate attention.

Operator Cost Percentages Can Be Misleading

Many developers chase the operator with the highest percentage.

Sort
80%
Index Seek
5%
Nested Loops
10%

Those percentages are only relative to that single execution plan.

They are not actual execution time.

A Sort showing 80% isn’t necessarily slow.

Always combine cost percentages with:

  • Actual execution time
  • Logical reads
  • CPU usage
  • Actual row counts

Never optimize based on percentages alone.

Warnings Deserve Your Attention

Execution plans sometimes display warning symbols.

Examples include:

  • Missing indexes
  • Implicit conversions
  • TempDB spills
  • Excessive memory grants
  • Cardinality estimation issues

Warnings don’t automatically mean something is wrong.

But they’re excellent starting points for investigation.

Missing Index Recommendations

SQL Server may suggest a missing index.

Missing Index

Treat these recommendations as hints — not instructions.

Before creating any index:

  • Verify the workload.
  • Check existing indexes.
  • Consider write overhead.
  • Evaluate maintenance costs.

Blindly creating every suggested index often creates more problems than it solves.

A Practical Troubleshooting Workflow

Whenever I analyze a slow query, I follow the same sequence:

  1. Capture the Actual Execution Plan.
  2. Read it from right to left.
  3. Look at arrow thickness.
  4. Compare estimated and actual rows.
  5. Identify scans, lookups, sorts, and expensive joins.
  6. Check warnings.
  7. Review indexes and statistics.
  8. Measure improvements after every change.

This systematic approach prevents random tuning and leads to much more consistent results.

Final Thoughts

Execution plans may look intimidating at first, but they become surprisingly approachable once you know what to focus on.

You don’t need to memorize every operator or become an optimizer expert overnight.

Instead, concentrate on understanding how data flows through the plan, pay attention to row counts, and investigate significant mismatches between estimates and reality.

Over time, you’ll stop seeing execution plans as confusing diagrams and start seeing them for what they truly are: one of the most valuable diagnostic tools available in SQL Server.

The more execution plans you read, the easier performance tuning becomes.

Enjoyed this article?

I regularly write about SQL Server performance, execution plans, indexing strategies, query optimization, and enterprise software engineering. Feel free to follow me here on Medium and connect with me on LinkedIn for more technical content.

Bruno Destro
Bruno Destro

Written by Bruno Destro

Senior Software Engineer sharing real-world lessons on SQL Server, .NET, software architecture, performance optimization and enterprise systems.

Stackademic
Stackademic

Published in Stackademic

Stackademic is a learning hub for programmers, devs, coders, and engineers. Our goal is to democratize free coding education for the world.