Sql-server – SQL Server : Included columns in an Index: is there something like “too many”

indexsql server

We have a table in one of our databases with approximately following structure:

Field1 int primary key
Field2 int foreign key A
Field3 int foreign key B
Field4 int foreign key C
Field5 ... Field70 diverse data types, for the "payload"

There are indices on the foreign key columns, albeit only with key columns, without any included columns. The index analysis routine keeps suggesting new indices with the same key columns for which there are already indices there, but with many included columns – in one case even all the Field5 to Field70. I am a bit hesitant to create an index with so many included columns – it feels like duplicating the table itself.

Are there some rule-of-thumb limits for the count of included columns in an index, or should I just go forward and replace the existing index (key column only) with an index with the same key column and so many included columns?

Thanks in advance.

Best Answer

Some of your main considerations with included columns are:

  • Would the query plan otherwise result in a lookup?
  • How many executions occur for the lookup operator?
  • Is the added overhead of maintaining that extra piece of data (for change) counter productive to performance? -and remember included columns are only present in the leaf level pages of the non clustered index so they are nowhere near as costly as index columns.
  • Added storage overhead on disk and obviously (if read) in buffer cache.