No Serial Order Exists
mytab starts with four rows:
| class | value |
|---|---|
| 1 | 10 |
| 1 | 20 |
| 2 | 100 |
| 2 | 200 |
Both transactions run at SERIALIZABLE.
| time | Transaction A | Transaction B |
|---|---|---|
| t1 | SELECT sum(value) FROM mytab WHERE class = 1; returns 30 |
|
| t2 | SELECT sum(value) FROM mytab WHERE class = 2; returns 300 |
|
| t3 | INSERT INTO mytab VALUES (2, 30); |
|
| t4 | INSERT INTO mytab VALUES (1, 300); |
|
| t5 | COMMIT; |
|
| t6 | COMMIT; |
What happens at t5 and t6, and would REPEATABLE READ have caught the same problem?
Sign in to answer questions and track your progress
Sign In