---
title: "What is difference between INDEX SEEK vs INDEX SCAN?"  
description: "What is difference between INDEX SEEK vs INDEX SCAN?"  
author: "Anubhav Sharma"  
published: 2026-05-04  
updated: 2026-05-04  
canonical: https://www.mindstick.com/interview/34501/what-is-difference-between-index-seek-vs-index-scan  
category: "database"  
tags: ["database", "sql server"]  
reading_time: 4 minutes  

---

# What is difference between INDEX SEEK vs INDEX SCAN?

Understanding how SQL Server reads data is key to performance tuning. Two common operations you’ll see in execution plans are **Index Seek** and **Index Scan**.

## What is INDEX SEEK?

- An **Index Seek** is a targeted lookup.
- SQL Server uses the index to **jump directly to matching rows**
- Very **fast and efficient**
- Works when your query has **selective filters**

## Example:

```plaintext
SELECT * FROM Employees
WHERE Id = 100;
```

If `Id` is indexed, SQL Server performs an **Index Seek**

## What is INDEX SCAN?

- An **Index Scan** reads a large portion (or all) of the index.
- SQL Server **scans multiple rows/pages**
- Slower compared to seek (for large tables)
- Happens when filtering is **not selective**

## Example:

```plaintext
SELECT * FROM Employees
WHERE Name LIKE '%John%';
```

Leading wildcard prevents index usage → **Index Scan**

## Key Differences

| Feature | INDEX SEEK | INDEX SCAN |
| --- | --- | --- |
| Data Access | Direct lookup | Sequential scan |
| Performance | Fast | Slower (large data) |
| Use Case | Exact/filtered queries | Broad/unfiltered queries |
| Efficiency | High | Low (for large tables) |

## When Does SQL Server Choose Each?

### Index Seek:

- `WHERE Id = 10`
- `WHERE Email = 'test@mail.com'`
- Proper indexing + selective condition

### Index Scan:

- `WHERE Name LIKE '%abc%'`
- No index on column
- Large result set

## Important Note

- **Index Scan is not always bad**
- For small tables → scan can be faster
- When most rows are needed → scan is logical

## How to Improve (Convert Scan → Seek)

- Add proper indexes
- Avoid leading wildcards (`%abc`)
- Use correct data types
- Write optimized WHERE clauses

## Example Optimization

Bad:

```plaintext
WHERE Name LIKE '%John%'
```

Better:

```plaintext
WHERE Name LIKE 'John%'
```

## Final Thought

- **Index Seek = Fast, precise search**
- **Index Scan = Broad, full scan**

A good database design aims to **maximize seeks and minimize unnecessary scans** for better performance.

## Answers

### Answer by Anubhav Sharma

Understanding how SQL Server reads data is key to performance tuning. Two common operations you’ll see in execution plans are **Index Seek** and **Index Scan**.

## What is INDEX SEEK?

- An **Index Seek** is a targeted lookup.
- SQL Server uses the index to **jump directly to matching rows**
- Very **fast and efficient**
- Works when your query has **selective filters**

## Example:

```plaintext
SELECT * FROM Employees
WHERE Id = 100;
```

If `Id` is indexed, SQL Server performs an **Index Seek**

## What is INDEX SCAN?

- An **Index Scan** reads a large portion (or all) of the index.
- SQL Server **scans multiple rows/pages**
- Slower compared to seek (for large tables)
- Happens when filtering is **not selective**

## Example:

```plaintext
SELECT * FROM Employees
WHERE Name LIKE '%John%';
```

Leading wildcard prevents index usage → **Index Scan**

## Key Differences

| Feature | INDEX SEEK | INDEX SCAN |
| --- | --- | --- |
| Data Access | Direct lookup | Sequential scan |
| Performance | Fast | Slower (large data) |
| Use Case | Exact/filtered queries | Broad/unfiltered queries |
| Efficiency | High | Low (for large tables) |

## When Does SQL Server Choose Each?

### Index Seek:

- `WHERE Id = 10`
- `WHERE Email = 'test@mail.com'`
- Proper indexing + selective condition

### Index Scan:

- `WHERE Name LIKE '%abc%'`
- No index on column
- Large result set

## Important Note

- **Index Scan is not always bad**
- For small tables → scan can be faster
- When most rows are needed → scan is logical

## How to Improve (Convert Scan → Seek)

- Add proper indexes
- Avoid leading wildcards (`%abc`)
- Use correct data types
- Write optimized WHERE clauses

## Example Optimization

Bad:

```plaintext
WHERE Name LIKE '%John%'
```

Better:

```plaintext
WHERE Name LIKE 'John%'
```

## Final Thought

- **Index Seek = Fast, precise search**
- **Index Scan = Broad, full scan**

A good database design aims to **maximize seeks and minimize unnecessary scans** for better performance.


---

Original Source: https://www.mindstick.com/interview/34501/what-is-difference-between-index-seek-vs-index-scan

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
