Note that there are some explanatory texts on larger screens.

plurals
  1. POIf one avoids READ_COMMITTED_SNAPSHOT and WITH NOLOCK, whats next?
    primarykey
    data
    text
    <p>Wow - so much info on why to avoid both options.</p> <p><a href="https://stackoverflow.com/questions/4587276/to-nolock-or-not-to-nolock-that-is-the-question">To NOLOCK or NOT to NOLOCK, that is the question</a></p> <p><a href="http://www.jimmcleod.net/blog/index.php/2009/08/27/the-potential-dangers-of-the-read-committed-snapshot-isolation-level/" rel="nofollow noreferrer">http://www.jimmcleod.net/blog/index.php/2009/08/27/the-potential-dangers-of-the-read-committed-snapshot-isolation-level/</a></p> <p>Some say go ahead and use read-committed and use locking hints. Others say you should generally avoid locking hints. </p> <p>Turning read-committed on can cause very unexpected behavior in I think a lot of typical applications in how systems wrap basic transactional code.</p> <p>So - the problem remains for us. We see on a production system many blocking queries after a sybase migration. Transaction time is extremely important to us - some are blocking for 10+ seconds - all over the place. </p> <p>If one is to avoid either techniques - I would like to understand some <em>internals</em> of what is going on here. Can this problem always be solved by better/proper indexes or can index switching in queries still cause locks (for instance, an update can use one non clustered index to search, and the clustered index for the row locking)</p> <p>Lets say we do the following:</p> <p>Select * from Customer Where CreatedDate > '6/30/2011'</p> <p>CreatedDate has an index but is obviously not a key.</p> <p>We see cases like this causing blocks (not deadlocks - but long waits) to statements such as (this is just demo code to show a similar scenario)</p> <p>Update Customer Set OrderReviewed=1 Where CreatedDate Between '6/24/2011' and '7/2/2011'</p> <p>Some say Select * from Customer with (nolock) Where CreatedDate > '6/30/2011'</p> <p>Is the way to go - however since Customer can be deleted, page splits, etc you can suffer from a variety of issues.</p> <p>We cannot turn READ_COMMITTED_SNAPSHOT on now for potential application impact. </p> <p>We have an index on CreatedDate - so... what else can one do?</p> <p>I'm looking for some expert advice here - meaty good technical info - not something like 'turn profiler on' or 'see what is blocking' as we know <em>what</em> is blocking, just not the internals of why or the <em>best</em> way to solve it. </p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload