有没有办法增加 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/