sql - SQL Server 中非聚集索引的解决方法最大键长度

标签 sql sql-server database tsql

有没有办法增加 SQL Server 中 1700 字节的非聚集索引的限制?当我构建我的数据库时,我收到此警告:

Warning! The maximum key length for a nonclustered index is 1700 bytes. The index 'CS_UK' has maximum length of 8000 bytes. For some combination of large values, the insert/update operation will fail.



还是我必须更改索引的结构?

最佳答案

即使可能,您也应该考虑更改索引结构。
话虽如此,来自 the blog of the engineering team :

SQL Server 2016 and Azure SQL Database have increased the maximum size for index keys with nonclustered indexes. The new maximum key size for nonclustered indexes is 1700 bytes. The maximum key size for clustered indexes remains 900 bytes.



在文章的最后他们补充说:

For memory-optimized tables: the maximum index key size for nonclustered indexes is 2500 bytes; there is no strict limit on index key size for hash indexes.



所以它可能是可能的。

关于sql - SQL Server 中非聚集索引的解决方法最大键长度,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56936219/

相关文章:

sql - 如何进行正确的计算?

mysql - 你的 SQL 语法有错误 ...near '' '

sql - 将单行扩展到多行

"FROM"不同运算符用法之间的MySQL性能差异

sql-server - 无法使用 pymssql 连接到 SQL Server 数据库,但可以使用底层 freetds tsql 连接

c# - 何时在 C# 中使用 SqlConnection.ClearAllPools()

sql - 选择每年的 TOP 记录

ruby-on-rails - Capistrano 部署删除数据库?

php - 如何将带有php的下拉菜单的值传递给数据库

php - MYSQL PHP 单数据库应用性能