ANn -425914 (2/27/2015)
I forgot to ask:for indexes, does the order of column matters?
For example I want to create an index of ID, SchoolID, on terms table.
Does the order of the column matter in the index?
Thanks,
Absolutely. In your example above, the best you could get out of such an index when looking for SchoolID would be an index scan and only if you're lucky enough for SQL Server to realize that the narrow NCI would be quicker to scan than doing a clustered index scan. The column order of (especially the first column) of any index is uber important.
--Jeff Moden
Change is inevitable... Change for the better is not.