Baber Amin
asked on
How to know which tables getting lock escalation
Hi,
How to know which tables getting lock escalation? Can below query can tell? so that I have to change lock escalation only for specific tables only.
SELECT OBJECT_NAME(ddios.[object_ id], ddios.database_id) AS [object_name] ,
i.name AS index_name ,
ddios.index_id ,
ddios.partition_number ,
ddios.index_lock_promotion _attempt_c ount ,
ddios.index_lock_promotion _count ,
( ddios.index_lock_promotion _attempt_c ount
/ ddios.index_lock_promotion _count ) AS percent_success
FROM sys.dm_db_index_operationa l_stats(DB _ID(), NULL, NULL, NULL) ddios
INNER JOIN sys.indexes i ON ddios.OBJECT_ID = i.OBJECT_ID
AND ddios.index_id = i.index_id
WHERE ddios.index_lock_promotion _count > 0
How to know which tables getting lock escalation? Can below query can tell? so that I have to change lock escalation only for specific tables only.
SELECT OBJECT_NAME(ddios.[object_
i.name AS index_name ,
ddios.index_id ,
ddios.partition_number ,
ddios.index_lock_promotion
ddios.index_lock_promotion
( ddios.index_lock_promotion
/ ddios.index_lock_promotion
FROM sys.dm_db_index_operationa
INNER JOIN sys.indexes i ON ddios.OBJECT_ID = i.OBJECT_ID
AND ddios.index_id = i.index_id
WHERE ddios.index_lock_promotion
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Actually reason to do that is we have some operations which creates locks on the tables which stops the applications functionality. We can afford if applications slows down little bit when large operations are going on (which are rare, few times a month only) but keep functioning.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Do you have a particular reason to not let the SQL Server engine take care of the lock escalations?