这道题关于partition-level lock escalation

谁是谁的谁 2011-12-01 10:20:15
You deploy a new database application to a SQL Server 2008 instance on a server that has 4 processor cores and 64 GB of RAM. The application uses partitioned tables. During testing, deadlocks occasionally
occur on queries that are attempting to read data. You find out that the deadlocks are related to the table partitions. You need to ensure that the application executes without deadlocks for the read queries. You
also need to ensure that dirty reads do not occur. What should you do? (More than one answer choice
may achieve the goal. Select the BEST answer.)
A.Disable partition-level lock escalation.
B.Move each partitioned table to its own filegroup.
C.Add additional database files to each partitioned table.
D.Move the clustered indexes for the partitioned tables to a separate filegroup.

标准答案为何是A呢/
...全文
78 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
中国风 2011-12-02
  • 打赏
  • 举报
回复
參照這樣

SET ( LOCK_ESCALATION = { AUTO | TABLE | DISABLE } )

指定允许的对表的锁进行升级的方法。

AUTO

此选项允许 SQL Server 数据库引擎选择适合于表架构的锁升级粒度。

如果该表已分区,则允许将锁升级到分区。锁升级到分区级别之后,该锁以后将不会升级到 TABLE 粒度。

如果该表未分区,则会将锁升级到 TABLE 粒度。

TABLE

无论表是否已分区,都会在表级粒度完成锁升级。此行为与 SQL Server 2005 中相同。默认值为 TABLE。
DISABLE

在大多数情况下禁止锁升级。表级别的锁未完全禁止。例如,当扫描在可序列化隔离级别下没有聚集索引的表时,数据库引擎必须使用表锁来保证数据的完整性。

鎖升級的原理
http://msdn.microsoft.com/zh-cn/library/ms184286.aspx
谁是谁的谁 2011-12-02
  • 打赏
  • 举报
回复
排除法
-晴天 2011-12-01
  • 打赏
  • 举报
回复
2.分区表在哪个分区文件中与死锁关系不大
3.添加分区文件对分区表发生死锁作用不大
4.聚集索引是建分区表的必须,并不能把它建到独立的文件组中去

22,210

社区成员

发帖
与我相关
我的任务
社区描述
MS-SQL Server 疑难问题
社区管理员
  • 疑难问题社区
  • 尘觉
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧