dbTalk Databases Forums  

Locking

microsoft.public.sqlserver.server microsoft.public.sqlserver.server


Discuss Locking in the microsoft.public.sqlserver.server forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Himanshu Jani
 
Posts: n/a

Default Locking - 10-16-2003 , 05:10 AM






Hi all,

SQL server doesnt provide any kind of configuration to
control granularity of locking on tables. As per books
online it is managed dynamically.

I have a major problem with my SQL Server, during
execution of one SP, on one table with 400+ rows it
acquires 600,000 locks. My profiler shows
whooping 'Lock:Acquired' on this particular table.

Can somebody please throw some light on this? Why SQL
server doesn't promote it to single table level lock? Is
there any bug in SQL?

thanks very much
Himanshu Jani

Reply With Quote
  #2  
Old   
Tibor Karaszi
 
Posts: n/a

Default Re: Locking - 10-16-2003 , 05:26 AM






You probably want to keep working on why this happens in the first place (although there's not much
to go on for us), but here are a couple of options for immediate fix:

Specify lock hint in the query (TABLOCK, for instance).
Configure the index used to not allow row locks (sp_indexoption).

--
Tibor Karaszi, SQL Server MVP
Archive at: http://groups.google.com/groups?oi=djq&as ugroup=microsoft.public.sqlserver


"Himanshu Jani" <anonymous (AT) discussions (DOT) microsoft.com> wrote

Quote:
Hi all,

SQL server doesnt provide any kind of configuration to
control granularity of locking on tables. As per books
online it is managed dynamically.

I have a major problem with my SQL Server, during
execution of one SP, on one table with 400+ rows it
acquires 600,000 locks. My profiler shows
whooping 'Lock:Acquired' on this particular table.

Can somebody please throw some light on this? Why SQL
server doesn't promote it to single table level lock? Is
there any bug in SQL?

thanks very much
Himanshu Jani



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.