Quick revision
The short answer
With READ_COMMITTED_SNAPSHOT on, SQL Server's READ COMMITTED stops taking shared locks for reads and reads the last committed row version instead, so reports no longer block writers and writers no longer block reports. The costs are a version store that grows while long reports run, extra bytes per changed row, and changed behaviour for any code that relied on reads blocking. Before approving it, I would review the version store capacity and that code, test under production-like load, and still consider moving reports to a replica.
What to remember
In this answer, we saw that locking READ COMMITTED makes readers and writers block each other through shared and exclusive locks, and that RCSI replaces shared read locks with row versions, so reports and updates stop blocking while writers still block writers. Before approving, we review the version store, which long reports keep growing, the code that depended on blocking reads, and test under realistic load. Moving reports to a replica or reporting store addresses the root cause.
Your turn
Answer it aloud as you would in the interview, or type your answer below. Then show one part at a time and compare.
With READ_COMMITTED_SNAPSHOT on, SQL Server's READ COMMITTED stops taking shared locks for reads and reads the last committed row version instead, so reports no longer block writers and writers no longer block reports. The costs are a version store that grows while long reports run, extra bytes per changed row, and changed behaviour for any code that relied on reads blocking. Before approving it, I would review the version store capacity and that code, test under production-like load, and still consider moving reports to a replica.
Why this question is asked
Turning on RCSI is a one-line change that can make blocking disappear overnight, which is exactly why it deserves a careful review: it changes how every read in the database behaves. Interviewers ask this scenario because it checks whether we understand locking versus versioning, where SQL Server keeps versions, and which application patterns silently break. In this answer, we will recap how locking READ COMMITTED causes the blocking, see what RCSI changes, then go through the risks: the version store, long reports, and code that depended on readers blocking, and finish with the alternatives.
1A Quick Recap: Why Reports Block the Online System
By default, SQL Server implements READ COMMITTED with locks. As a query reads a row or page, it takes a shared lock on it and releases it once it moves on. A writer needs an exclusive lock on the rows it changes and keeps it until commit. Shared and exclusive locks conflict, so a reader that reaches a row being updated waits for the writer's commit, and a writer that needs a row currently under a reader's shared lock waits for the reader.
Long analytical queries scan millions of rows and often take page or table level shared locks, sometimes escalated or held longer with hints such as REPEATABLE READ or HOLDLOCK. Short order updates then wait behind them, and the queue of waiting requests grows. That is the blocking the online system sees.
2What READ_COMMITTED_SNAPSHOT Changes
RCSI keeps the isolation level name the same but changes its implementation. When a row is updated or deleted, SQL Server first copies the old committed version into a version store and links it from the row. A reader at READ COMMITTED then takes no shared row locks; at the start of each statement it notes a point in time, and for each row it reads the newest version committed before that point, following the chain into the version store when needed.
| Behaviour | Locking READ COMMITTED | RCSI |
|---|---|---|
| Reader meets uncommitted update | waits for the writer | reads previous committed version |
| Writer meets active reader | may wait for shared lock | does not wait |
| Writer meets writer | waits | waits |
| Extra storage | none | version store, about 14 bytes per changed row |
| Read consistency | per row as read | per statement |
So readers no longer block writers, and writers no longer block readers. Writers still block writers: two updates of the same row still queue on exclusive locks. And consistency is per statement, as before: each statement sees committed data as of its own start, not as of the transaction's start. That is different from SNAPSHOT isolation, which sees data as of the transaction's start and must be requested explicitly.
3Risk 1: The Version Store and Long Reports
The versions have to live somewhere. Traditionally the version store is in tempdb. With Accelerated Database Recovery, available from SQL Server 2019, versions go into a persistent version store inside the user database instead. Either way, versions can only be cleaned up when no running statement or transaction might still need them.
That is where long reports come back. A report that runs for 40 minutes keeps every version created during those 40 minutes alive. If the online system updates 5,000 rows a second, that is millions of versions, and tempdb or the user database grows by gigabytes. Long version chains also make reads slower. So the review must size the version store for the longest report under peak write load, and set alerts on its size, for example through sys.dm_tran_version_store_space_usage, and on the oldest active snapshot transaction.
4Risk 2: Code That Relied on Readers Blocking
This is the subtle risk. Some code is correct today only because a read waits for a concurrent writer. A typical example is read-then-update: read the stock count, check it in the application, then write the new value. Under locking READ COMMITTED the read waits while another transaction's update is uncommitted. Under RCSI the read returns the old committed value immediately, two requests can both see stock = 1, and both sell the last item.
So before approving we should search the code and stored procedures for read-then-write patterns, triggers that validate by reading other rows, and queue tables read without UPDLOCK or READPAST. Where a specific query really needs the old behaviour, the READCOMMITTEDLOCK table hint restores locking reads for that query alone.
5Testing and the Better Alternative
The change should be tested on a copy of production with replayed or synthetic load that includes the reports, measuring version store growth, tempdb or database file I/O, and the blocking and latency of the online system. Concurrency tests for the risky code paths should run against the RCSI copy.
But the cleaner answer to the original problem is often to move the reports away. An Always On readable secondary, a nightly or streaming copy into a reporting database, or a warehouse lets the reports run with no effect on the primary's locks or versions. RCSI is still a good default for most OLTP databases; it just should not be the only defence against 40-minute analytical scans on the primary.
6Follow-up questions
How is RCSI different from SNAPSHOT isolation?
RCSI changes the behaviour of the existing READ COMMITTED level for every session, with consistency per statement and no update conflicts raised. SNAPSHOT isolation must be enabled with ALLOW_SNAPSHOT_ISOLATION and then requested by each session; it gives one consistent view for the whole transaction, and if the transaction updates a row that someone else changed after the transaction started, it fails with an update conflict error that must be retried.
Can turning on RCSI cause deadlocks to disappear?
It removes reader-writer deadlocks, which are common under locking READ COMMITTED, so the deadlock rate often drops. Writer-writer deadlocks remain, because updates still take exclusive locks in whatever order the code touches rows.
Does NOLOCK in existing queries still matter?
NOLOCK, which is READ UNCOMMITTED, keeps reading uncommitted data even after RCSI is on. Since RCSI gives non-blocking reads of committed data, those hints usually become unnecessary and can be removed, which also removes the dirty and skipped-row reads they cause.
7Conclusion
In this answer, we saw that locking READ COMMITTED makes readers and writers block each other through shared and exclusive locks, and that RCSI replaces shared read locks with row versions, so reports and updates stop blocking while writers still block writers. Before approving, we review the version store, which long reports keep growing, the code that depended on blocking reads, and test under realistic load. Moving reports to a replica or reporting store addresses the root cause.
Open with
Today READ COMMITTED is lock-based, so the report's shared locks and the online writers' exclusive locks conflict in both directions. With READ_COMMITTED_SNAPSHOT, updates copy the previous committed version to the version store, and readers at READ COMMITTED take no shared locks; each statement reads the latest version committed before it started.
Then, if they want more
Readers stop blocking writers and the other way round, though writers still block writers. Before approving I'd check three things.
First, the version store: it's in tempdb, or in the user database's persistent version store if Accelerated Database Recovery is on, and a forty-minute report keeps forty minutes of versions alive under full write load, so I'd size and alert on it.
Second, behaviour changes: any read-then-update code that was only safe because reads waited for writers becomes a lost update, so I'd search for those patterns and fix them with UPDLOCK or a single conditional UPDATE, or use the READCOMMITTEDLOCK hint where locking reads are genuinely needed. Third, I'd test it on a production-like copy with the reports running.
And I'd still push to move the reports to a readable secondary or a reporting store, because that removes the load from the primary entirely.
About this answer
- Last updated
- 12 November 2026
- Checked
- Its structure and format are checked automatically. Use it as a carefully prepared study note: where a detail matters, confirm it against the documentation below. What the checks cover
- Where the question comes from
- Written by Scrivio for practice. It is not taken from an interview.
- Official documentation
- PostgreSQL documentation, MySQL reference manual
Report an issue with this answer
Copy the line below and send it to the author with what you found. It carries the address of this page.
Issue with "A reporting team runs long analytical queries against the primary SQL Server database...": https://scrivio-interview-library.netlify.app/databases/database-locking/dd29a26ac3/