AgentFire
AgentFire

Reputation: 9780

What is "include only" option on the mssql index creation tab?

There is a "Include Only" option in each row (which is actually a table column) in the index. What is it and is it needed for?

http://pasteboard.s3.amazonaws.com/images/1350293092227927.png

(SQL Manager lite for SQL Server)

Upvotes: 0

Views: 234

Answers (1)

Pete Carter
Pete Carter

Reputation: 2731

Include only will make it an "included column". Included columns are only included at the leaf level of the index rather than in every level of the b-tree. This gets around max size/no of columns in the key and allows you to more easily cover queries

The way you would normally use included columns is as follows:

When creating an index to support a query, add the columns included in WHERE, JOIN and aggregate functions, etc to the index key. Columns that only appear in the SELECT list, add as Included Columns. This means that SQL Server will be able to seek the index but then obtain the remaining columns from the bottom of the index, without having to jump to the Heap or Clustered Index to obtain the columns.

Upvotes: 3

Related Questions