SQL Server Interview Question #128
What are included columns in an index?
Indexes & Query Performance Senior Advanced
Detailed Explanation
Included columns are non-key columns stored at the leaf level of a nonclustered index. They can allow an index to cover a query without increasing the logical key used for sorting and seeking.
INCLUDE is useful for columns needed only in the SELECT list while other columns are used for filtering or joining. Included columns still consume storage and increase write maintenance, so they should be added selectively.
Code Example
CREATE INDEX IX_Products_CategoryId
ON dbo.Products(CategoryId)
INCLUDE (Name, Price, Rating);