by anarazel · 2w ago · 0 comments
1) If you do BEGIN; SELECT nextval('someseq'); ROLLBACK; the value from the rolled back transaction won't be reused, despite the rollback. That's quite crucial for performance, as otherwise concurrent transactions would not be able to get a sequence value until the first transaction commits/rolls back.
2) If you crash (PG or HW), some sequence values may never end up being used. For performance only every 32nd sequence advancement is WAL logged.
No comments yet.