Suppose, I have a table
product with integer column
Here are two transactions that I begin at the same time (almost):
BEGIN TRANSACTION ISOLATION LEVEL SERIALIZABLE; UPDATE "product" SET price = 13;
BEGIN TRANSACTION ISOLATION LEVEL SERIALIZABLE; insert into "product" (id, price) values ('three', 10);
Now suppose I commit T2 first. And then T1.
My result after both transactions finish is:
| id | price --------------- | one | 13 | | two | 13 | | three| 10 |
This is perplexing to me as I would have expected the serialized order to be T2 -> T1 (since T2 finished much befor) but the result set implies the serialized order is T1 -> T2.
Also, I might also have been okay with T1 getting aborted because of T2 committing.