Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase ««12

Read Committed_Snapshot Expand / Collapse
Author
Message
Posted Monday, March 18, 2013 10:14 AM
SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Today @ 10:13 AM
Points: 2,857, Visits: 5,129
Oops, too many windows. Post edited!
Actually, the code version you have seen for window 2, was a good code example, which would work properly with any isolation level...


_____________________________________________
"The only true wisdom is in knowing you know nothing"
"O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!"
(So many miracle inventions provided by MS to us...)

How to post your question to get the best and quick help
Post #1432253
Posted Monday, March 18, 2013 10:41 AM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Yesterday @ 9:27 PM
Points: 13,776, Visits: 28,178
Eugene Elutin (3/18/2013)
Grant Fritchey (3/18/2013)
... or two as well.


Googled out the second one (surprisingly to me - based on "stock management":

http://www.jimmcleod.net/blog/index.php/2009/08/27/the-potential-dangers-of-the-read-committed-snapshot-isolation-level/




OK. For a lock control system as outlined, this would be a nightmare. No question.

I'd still suggest this is on the rarer side of the spectrum (if not actually rare), but it's absolutely worth noting.

Thanks!


----------------------------------------------------
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood..." Theodore Roosevelt
The Scary DBA
Author of: SQL Server Query Performance Tuning
SQL Server 2012 Query Performance Tuning
SQL Server 2008 Query Performance Tuning Distilled
and
SQL Server Execution Plans

Product Evangelist for Red Gate Software
Post #1432265
Posted Monday, March 18, 2013 11:13 AM
SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Today @ 10:13 AM
Points: 2,857, Visits: 5,129
Grant Fritchey (3/18/2013)
Eugene Elutin (3/18/2013)
Grant Fritchey (3/18/2013)
... or two as well.


Googled out the second one (surprisingly to me - based on "stock management":

http://www.jimmcleod.net/blog/index.php/2009/08/27/the-potential-dangers-of-the-read-committed-snapshot-isolation-level/




OK. For a lock control system as outlined, this would be a nightmare. No question.

I'd still suggest this is on the rarer side of the spectrum (if not actually rare), but it's absolutely worth noting.

Thanks!


Rarer or rare - I don't know how to judge. I've seen it happening before and not once...
Actually, when it happens, it may take huge effort to investigate and find the reason, as code doesn't fail - it runs smoothly
So, thanks for agreeing that it was worth mentioning. So pity, I've made mistake in my sample on the first posting...


_____________________________________________
"The only true wisdom is in knowing you know nothing"
"O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!"
(So many miracle inventions provided by MS to us...)

How to post your question to get the best and quick help
Post #1432276
Posted Monday, March 18, 2013 4:40 PM
SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Today @ 10:32 AM
Points: 2,121, Visits: 3,205
winmansoft, you should also be aware of the 14-byte-per-row overhead that READ_COMMITTED_SNAPSHOT requires. Anytime a row is updated, or a new row is inserted, the 14 bytes will be added. This can cause page splits if you don't have enough freespace in the page to hold the extra 14 bytes for each row updated.

There is also a big initial performance hit for any "old-style" ntext, text, and image columns (but not for the newer (max) data types). After RCS is enabled, the first time one of those "old-style" large columns are updated, SQL will have to rewrite the entire value, possibly using more pages (since each page holds 40 less bytes).


SQL DBA,SQL Server MVP('07, '08, '09)

Carl Sagan said: "There is no such thing as a dumb question." Sagan obviously never watched a congressional hearing!
Post #1432393
Posted Tuesday, March 19, 2013 10:44 PM
SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Sunday, September 21, 2014 10:47 PM
Points: 269, Visits: 1,732
when the rows will be added to tempdb(update statement, select statement) and when it is cleared ?
Post #1432990
Posted Tuesday, March 19, 2013 11:39 PM
SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Sunday, September 21, 2014 10:47 PM
Points: 269, Visits: 1,732
when the rows will be added to tempdb(update statement, select statement) and when it is cleared ?
Post #1433001
Posted Wednesday, March 20, 2013 4:47 AM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Yesterday @ 9:27 PM
Points: 13,776, Visits: 28,178
winmansoft (3/19/2013)
when the rows will be added to tempdb(update statement, select statement) and when it is cleared ?


Read the documentation supplied by Microsoft. They lay it out there. In the most basic way, when the transaction starts a copy is made in tempdb and reads then go there while the data is updated in the original database. When the transaction completes, the copy is removed from temdb. In actuality it's more complicated than that, but that's it in a nutshell. Again, read the documentation.


----------------------------------------------------
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood..." Theodore Roosevelt
The Scary DBA
Author of: SQL Server Query Performance Tuning
SQL Server 2012 Query Performance Tuning
SQL Server 2008 Query Performance Tuning Distilled
and
SQL Server Execution Plans

Product Evangelist for Red Gate Software
Post #1433126
« Prev Topic | Next Topic »

Add to briefcase ««12

Permissions Expand / Collapse