Rudziankoŭ
Rudziankoŭ

Reputation: 11251

serializable snapshot isolation and select for update

I just have read serializable snapshot isolation in PostgresQL and understood from it that using this isolation level DB by itself preventing so called writing skew.

The question: is it still meaningful for DB when I mark reads with FOR UPDATE sql postfix when it's going to be update after read?

Upvotes: 1

Views: 260

Answers (1)

Laurenz Albe
Laurenz Albe

Reputation: 246483

Yes, it is meaningful. By using FOR UPDATE, you can prevent some serialization errors from happening (because you are explicitly serializing operations), which will improve performance if conflicts are frequent.

Upvotes: 1

Related Questions