SQL Server Interview Question #134

What is a Key Lookup?

Indexes & Query Performance Senior Advanced

Detailed Explanation

A Key Lookup occurs when SQL Server uses a nonclustered index to identify qualifying rows but then needs additional columns from the clustered index that are not present in the nonclustered index.

A small number of lookups can be efficient. A large number can become expensive because each qualifying row may require additional access.

Possible solutions include changing the query, adding appropriate INCLUDE columns, redesigning the index, or accepting the lookup if the measured cost is low.