Monday, July 29, 2013

optimize the query

Hi SQL_Gun,



Database Engine does not consider nonkey columns when calculating the number of index key columns or the total size of the index key columns, please try to create a nonclustered index on string, code columns and includes text column:



create nonclustered index IndexName on TableName(string, code)
INCLUDE ([text])

For more detail information, you can refer to the following link:



Maximum Size of Index Keys

http://msdn.microsoft.com/en-us/library/ms191241(v=sql.105).aspx





Allen Li

TechNet Community Support



No comments:

Post a Comment