SQL Server包含的列是否占用双倍的空间?

怪物MMORPG

我的问题是,例如,我有以下专栏

Cl1 int - primary key
Cl2 int
Cl3 nvarchar(200)
Cl4 nvarchar(max)

现在假设我创建一个非聚集索引Cl2但是当我查询Cl2我始终检索Cl3Cl4也。

包含Cl3在索引中是合乎逻辑的,因为它可以使检索操作更快,但是Cl4nvarchar(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] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章