Conversation

Replying to
Congrats! Very thorough and clear article. As to why subtransactions use own txids consider that they are used for A (and indirectly D) from ACID as well. Your surprise at the end of the article considers only I.
1
1
Replying to
Thanks. Yeah, I see what you're saying: if we inserted a row in a subtrans, the did ROLLBACK TO SAVEPOINT, then we need to consider such tuple as dead - but with "main XID" it would be not directly possible without extra actions.
1
1
Replying to and
This resonates with my general understanding of Postgres MVCC approach as "commit-pessimistic" (or "rollback-optimistic") -- I would better prefer having UNDO log here too, and more overhead for cases of [partial] ROLLBACK than constant overhead for committed transactions.
1
1
Replying to and
I agree with your conclusion (I think), but I still don't think that Postgres MVCC is rollback optimistic 🙂. Turns out that rollbacks used by the TPC-C benchmark contribute significantly to the disproportionate problems we see with free space management:
Getting free space back immediately after Rollback would be nice, but you really do not want to make that part of Rollback cmd itself. (I just discovered the thread on pghackers, probabli this is already there). But also CHECKPOINT should do cleanup, freeze, etc.
1