zoukankan      html  css  js  c++  java
  • 索引视图导致死锁

    背景:

      开始并不在意索引视图会导致死锁。

    问题:

      出现死锁,update t1 表尽然发现会去锁t2表从而导致死锁。

    原因:

      是因为索引视图才会导致死锁问题。单从update的执行计划也能看出问题

    例子:

      

    create table t1(id int primary key,a int)
    create table t2(id int primary key,a int)
    go
    
    CREATE VIEW [dbo].[DLV_AllProductItems]
    WITH SCHEMABINDING
    AS
    SELECT       a.id,a.a,b.id as idb,b.a as ab
    FROM            dbo.t1 a
    	inner join dbo.t2 b on a.id = b.id
    
    
    
    GO
    
    create unique clustered index ix on t(id)
    update t1 set a=1 where id =1
    

      

  • 相关阅读:
    ionic框架
    第3课
    第7课
    第6课
    第5课
    第4课
    第3课
    第2课
    第2课
    第1课
  • 原文地址:https://www.cnblogs.com/Amaranthus/p/6238339.html
Copyright © 2011-2022 走看看