我的问题是,例如,我有以下专栏
Cl1 int - primary key
Cl2 int
Cl3 nvarchar(200)
Cl4 nvarchar(max)
现在假设我创建一个非聚集索引Cl2
但是当我查询Cl2
我始终检索Cl3
和Cl4
也。
包含Cl3
在索引中是合乎逻辑的,因为它可以使检索操作更快,但是Cl4
它nvarchar(max)
也可能非常大:此列包含已爬网的页面源
所以我的问题是:是否Cl4
在非聚集索引中包括逻辑上是合理的
包括它是否将Cl4
精确地存储在硬盘上2次?
非常感谢您的回答
SQL Server 2014
从针对SQL Server 2014的联机丛书中获得:
Up to 16 columns can be combined into a single composite index key. All the columns in a composite index key must be in the same table or view. The maximum allowable size of the combined index values is 900 bytes.
Columns that are of the large object (LOB) data types ntext, text, varchar(max), nvarchar(max), varbinary(max), xml, or image cannot be specified as key columns for an index.
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句