Isolation

Definition: Execution of one txn is isolated from that of other txns.

Isolation LevelDirty ReadNonrepeatable ReadPhantom ReadSerialization Anomaly
Read uncommittedAllowed, but not in PGPossiblePossiblePossible
Read committed (PG default)Not possiblePossiblePossiblePossible
Repeatable read (MySQL default)Not possibleNot possibleAllowed, but not in PGPossible
SerializableNot possibleNot possibleNot possibleNot possible
  • SERIALIZABLE: Obtain all locks first; plus index locks, plus strong strict 2PL
  • REPEATABLE READ: Same as above, but no index locks.
  • READ COMMITTED: Same as above, but S locks are released immediately.
  • READ UNCOMMITTED: Same as above but allows dirty reads (no S locks).