Sample Header Ad - 728x90

Can a concurrent transaction see only part of committed changes?

3 votes
2 answers
500 views
This is a general question about database transaction isolation. Let's say we have a transaction reading some table and there is a writing transaction committing multiple updated rows in the same table. Is it possible that the reading transaction sees only some of the rows updated and the rest of the rows not updated? (I assume that all rows satisfy the reading statement search criteria, and there is no intervening writing transactions). Does the answer depend on the concurrency control mechanism used by database? For example, is it possible in PostgreSQL using snapshots or in SQL Server using locks? Does it depend on isolation level used, and if yes then how? This question is not about uncommitted changes. I am interested in whether changes committed by a concurrent transaction have a chance of being only partially seen by the reading transaction. Reformulating the question for PostgreSQL: Can a snapshot taken at the beginning of a statement or transaction contain only part of the changes made by a committing transaction? And a similar question for lock-based concurrency control.
Asked by yurish (205 rep)
May 1, 2025, 08:50 PM
Last activity: May 3, 2025, 05:27 PM