Skip to main content

Timeline for One index or two?

Current License: CC BY-SA 3.0

8 events
when toggle format what by license comment
Nov 29, 2013 at 14:22 comment added Kenneth Fisher @paulH It is probably just my opinion but at the point you have added enough columns to the include that your index has 90+% of your columns in the table you have bloated your index to the point that the extra read to go to the table itself isn't all that important. Now there are certainly exceptions .. if cols 1-5 are all int's and col6 is a varchar(max) then I might do it. But in general I would look at those VERY carefully.
Nov 28, 2013 at 15:26 vote accept paulH
Nov 27, 2013 at 23:23 comment added paulH @KennethFisher - why would that be silly? It seems a reasonable enough thing to do if your database structure and your workload warrant it. E.g. if you have a query that selects columns 1-5 based on the values of columns 1 and 2, and maybe column 6 is an nvarchar(max) column that you don't want to bloat your index with.
Nov 27, 2013 at 22:56 comment added Kenneth Fisher Not to mention that if the table only has cols 1-6 it's pretty silly to index 1 & 2 and include 3-5.
Nov 27, 2013 at 18:47 comment added Thomas Stringer Yep :-) Good catch. I've edited that out.
Nov 27, 2013 at 18:47 history edited Thomas Stringer CC BY-SA 3.0
deleted 6 characters in body
Nov 27, 2013 at 18:43 comment added paulH I'm going to have to digest that for a while but it seems like a good answer. I assume it was a typo that the 'index3' that you defined has col3 as an equality column AND an included column ?
Nov 27, 2013 at 18:34 history answered Thomas Stringer CC BY-SA 3.0