Skip to main content

How does SQL Server decide between a Table Scan, Index Scan, and Index Seek?

Entry MS SQL
Quick Answer SQL Server uses statistics (row count estimates) to pick the cheapest plan. Table Scan reads every row รขโ‚ฌโ€ used when there's no useful index or the whole table is needed. Index Scan reads the index but all rows. Index Seek jumps directly to matching rows รขโ‚ฌโ€ the most efficient, what you want for selective queries.

Answer

SQL Server chooses access methods based on filters, available indexes, and cost estimates.

Table Scan: Reads all rows when no useful index exists.

Index Scan: Reads all index entries for broad filters.

Index Seek: Most efficient; jumps directly to matching rows.

S
SugharaIQ Editorial Team Verified Answer

This answer has been peer-reviewed by industry experts holding senior engineering roles to ensure technical accuracy and relevance for modern interview standards.

Want to bookmark, take notes, or join discussions?

Sign in to access all features and personalize your learning experience.

Sign In Create Account

Source: SugharaIQ

Ready to level up? Start Practice