SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Read Committed_Snapshot


Read Committed_Snapshot

Author
Message
Eugene Elutin
Eugene Elutin
SSCertifiable
SSCertifiable (5.1K reputation)SSCertifiable (5.1K reputation)SSCertifiable (5.1K reputation)SSCertifiable (5.1K reputation)SSCertifiable (5.1K reputation)SSCertifiable (5.1K reputation)SSCertifiable (5.1K reputation)SSCertifiable (5.1K reputation)

Group: General Forum Members
Points: 5090 Visits: 5478
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!":-D
(So many miracle inventions provided by MS to us...)

How to post your question to get the best and quick help
Grant Fritchey
Grant Fritchey
SSC-Forever
SSC-Forever (40K reputation)SSC-Forever (40K reputation)SSC-Forever (40K reputation)SSC-Forever (40K reputation)SSC-Forever (40K reputation)SSC-Forever (40K reputation)SSC-Forever (40K reputation)SSC-Forever (40K reputation)

Group: General Forum Members
Points: 40973 Visits: 32666
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 and SQL Server Execution Plans
Product Evangelist for Red Gate Software
Eugene Elutin
Eugene Elutin
SSCertifiable
SSCertifiable (5.1K reputation)SSCertifiable (5.1K reputation)SSCertifiable (5.1K reputation)SSCertifiable (5.1K reputation)SSCertifiable (5.1K reputation)SSCertifiable (5.1K reputation)SSCertifiable (5.1K reputation)SSCertifiable (5.1K reputation)

Group: General Forum Members
Points: 5090 Visits: 5478
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 Hehe
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!":-D
(So many miracle inventions provided by MS to us...)

How to post your question to get the best and quick help
ScottPletcher
ScottPletcher
SSCrazy Eights
SSCrazy Eights (8.1K reputation)SSCrazy Eights (8.1K reputation)SSCrazy Eights (8.1K reputation)SSCrazy Eights (8.1K reputation)SSCrazy Eights (8.1K reputation)SSCrazy Eights (8.1K reputation)SSCrazy Eights (8.1K reputation)SSCrazy Eights (8.1K reputation)

Group: General Forum Members
Points: 8052 Visits: 7163
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)[size=2]Prosecutor James Blackburn, in closing argument in the Fatal Vision murders trial: If in the future, you should cry a tear, cry one for them [the murder victims]. If in the future, you should say a prayer, say one for them. And if in the future, you should light a candle, light one for them.[/size]
IT researcher
 IT researcher
Mr or Mrs. 500
Mr or Mrs. 500 (594 reputation)Mr or Mrs. 500 (594 reputation)Mr or Mrs. 500 (594 reputation)Mr or Mrs. 500 (594 reputation)Mr or Mrs. 500 (594 reputation)Mr or Mrs. 500 (594 reputation)Mr or Mrs. 500 (594 reputation)Mr or Mrs. 500 (594 reputation)

Group: General Forum Members
Points: 594 Visits: 1798
when the rows will be added to tempdb(update statement, select statement) and when it is cleared ?
IT researcher
 IT researcher
Mr or Mrs. 500
Mr or Mrs. 500 (594 reputation)Mr or Mrs. 500 (594 reputation)Mr or Mrs. 500 (594 reputation)Mr or Mrs. 500 (594 reputation)Mr or Mrs. 500 (594 reputation)Mr or Mrs. 500 (594 reputation)Mr or Mrs. 500 (594 reputation)Mr or Mrs. 500 (594 reputation)

Group: General Forum Members
Points: 594 Visits: 1798
when the rows will be added to tempdb(update statement, select statement) and when it is cleared ?
Grant Fritchey
Grant Fritchey
SSC-Forever
SSC-Forever (40K reputation)SSC-Forever (40K reputation)SSC-Forever (40K reputation)SSC-Forever (40K reputation)SSC-Forever (40K reputation)SSC-Forever (40K reputation)SSC-Forever (40K reputation)SSC-Forever (40K reputation)

Group: General Forum Members
Points: 40973 Visits: 32666
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 and SQL Server Execution Plans
Product Evangelist for Red Gate Software
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search