以下是信息:
Transaction (Process ID 80) was deadlocked on lock resources with another process and has been chosen as the deadlock victim. Rerun the transaction.
以下是查询:
update EDescriptionsCategories set CategoryId = Ids.CategoryId, AccessedDate = getdate()
from EDescriptionsCategories
join ( select * from (values (512528, 20870),(29596457, 20870)) as Ids(Id,CategoryId) ) as Ids on
Ids.Id = EDescriptionsCategories.Id
以下是表格定义:
CREATE TABLE [dbo].[EDescriptionsCategories](
[CategoryId] [int] NOT NULL,
[AccessedDate] [datetime] NOT NULL,
[Id] [int] NOT NULL,
CONSTRAINT [PK_EDescriptionsCategories] PRIMARY KEY CLUSTERED
(
[Id] ASC
)
其中一些查询并行运行。为什么单个原子更新死锁?
没有针对此表运行其他查询。除主键外没有索引。然而,这是一张2100万行的大表。