解决方法
对于资源哈希冲突的解释,我将在“%%lockres%% collision probability magic marker: 16,777,215”引用Remus Rusanu(推荐阅读):
The lock manager in sql Server doesn’t kNow what it locks,it just locks ‘resources’ (basically strings). It is the job of higher level components like the the access methods of the storage engine to present the ‘resource’ to the lock manager and ask for the desired lock. When locking rows in a heap or a b-tree the storage engine will synthesize a ‘resource’ from the record identifier. Since these resources have a limited length,the storage engine has to reduce the effective length of a key to the maximum length is allowed to present to the lock manager,and that means that the record’s key will be reduced to 6 bytes. This is achieved by hashing the key into a 6 byte hash value.
[…]
On 6 bytes there are 281,474,976,710,656 distinct possible values. Its a pretty big number? Not that big actually. […] So the sql %%lockres%% hash will produce two records with same hash,with a 50% probability,out of the table,any table,of only 16,215 record.
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。