Index Surgeon

Fix slow queries with the right index. 14 randomized levels covering clustered, nonclustered, covering, unique, computed, filtered, full-text, columnstore and hash indexes.

Learn SQL indexes by tuning real execution plans

Index Surgeon is a puzzle game about SQL Server indexing. Each level is a slow query ticket. You build indexes and watch a simulated execution plan change: table scans become seeks, key lookups disappear, sorts vanish and columnstore switches to batch mode. You cover every main index type: clustered, nonclustered, composite, covering with INCLUDE, unique, computed column, filtered, full-text, clustered and nonclustered columnstore, and hash indexes on memory-optimized tables. Every level also weighs write cost and storage, like real tuning.

Frequently asked questions

What is the difference between a clustered and a nonclustered index?

A clustered index is the table itself, stored in key order, so a table has only one. A nonclustered index is a separate sorted structure with key columns and a pointer to the row, the clustered key or a RID on a heap.

What is a covering index?

An index that contains every column a query needs, through key columns and INCLUDE columns, so the query never touches the base table and avoids key lookups.

When should I use a columnstore index?

For analytic queries that scan and aggregate many rows, such as reports and dashboards. Columnstore compresses data by column and runs in batch mode. Use a nonclustered columnstore for real-time analytics on an OLTP table.

What is a filtered index?

A nonclustered index with a WHERE clause that stores only matching rows. It is small and cheap to maintain, which suits queues and sparse status values.

Why does my query not use the index?

Common causes are functions on the indexed column, leading wildcards in LIKE, wrong column order in a composite index, implicit type conversions, or a query that needs so many lookups that a scan is cheaper.

The plan costs come from a simplified cost model meant for learning. Progress is saved in your browser.