<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Don't forget about locking hints! (posted by Aaron)</title><link>http://blogs.msdn.com/dditweb/archive/2005/12/29/508025.aspx</link><description>I'm a big fan of using locking hints when writing SQL queries. And I'm continually amazed at how many people don't understand (or know) how to use them. Locking hints can help to significantly improve performance of your database and with very little</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>re: Don't forget about locking hints! (posted by Aaron)</title><link>http://blogs.msdn.com/dditweb/archive/2005/12/29/508025.aspx#508070</link><pubDate>Fri, 30 Dec 2005 01:11:56 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:508070</guid><dc:creator>John Ingres</dc:creator><description>I disagree. &lt;br&gt;1. SQL uses row locking by default. If it escalates to pages locks, or worse table lock, it is because it is less expensive to do so. Forcing a row lock may decrease the server's scalability by consuming more memory than necessary for that query. &lt;br&gt;2. If you have locking problems, look at your query AND your indexes. &amp;quot;Let's also say that individual users who are accessing the data in this table are almost exclusively reading their own data&amp;quot; ... using MyID as the first column of your clustered index perhaps;)&lt;br&gt;3. SQL 2005 has row versionning. Enable it and forget your locking hints :-D&lt;br&gt;&lt;br&gt;ps: I am not againts locking hints, but I consider them a last resort and a general bad practice. A hint that helps today will cause problems in a few months/years because data distribution has changed.</description></item><item><title>re: Don't forget about locking hints! (posted by Aaron)</title><link>http://blogs.msdn.com/dditweb/archive/2005/12/29/508025.aspx#508086</link><pubDate>Fri, 30 Dec 2005 01:54:23 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:508086</guid><dc:creator>dditweb</dc:creator><description>Interesting thoughts. I guess I've never found a time when using locking hints caused problems down the road. Don't get me wrong - I'm all for indexes. They're MUCH more important than locking hints (I'm not arguing that they aren't)... I think what I'm trying to get across more than anything is that I find tons of folks who never even consider locking hints (and don't undesrtand them) and I've found them to be a big help. &lt;br&gt;&lt;br&gt;Like I said in the last sentence - blanket rules for locking hints is not recommended. But rather understanding them, understanding your data, and using them when necessary. &lt;br&gt;&lt;br&gt;Aaron</description></item><item><title>re: Don't forget about locking hints! (posted by Aaron)</title><link>http://blogs.msdn.com/dditweb/archive/2005/12/29/508025.aspx#8480506</link><pubDate>Fri, 09 May 2008 18:12:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8480506</guid><dc:creator>tom</dc:creator><description>&lt;p&gt;LOL - someone actually promoting bad practices or maybe this is sarcasm?&lt;/p&gt;
</description></item></channel></rss>