Read committed is a transaction isolation level in databases that guarantees a transaction never sees uncommitted changes made by other transactions, while still allowing data to change between two statements of the same transaction. In the theory of transactions it sits one step above read uncommitted and one step below repeatable read, and it is the default isolation level in PostgreSQL, Oracle Database and Microsoft SQL Server.
The level prevents dirty reads but permits non-repeatable reads, phantom reads and, without extra care, lost updates. That balance of reasonable correctness and high concurrency explains why most online transaction processing systems run on it without ever changing the setting.
How read committed isolates statements
Read committed works by giving each statement its own view of committed data rather than one view for the whole transaction. When a query starts, it sees every change that was committed before that moment and none of the changes still in progress, so two consecutive SELECT statements may return different results if another session commits in between.
Database engines implement this guarantee in two main ways. Multiversion concurrency control (MVCC) keeps older row versions so a reader can reconstruct the last committed state without waiting for writers. Lock-based implementations make readers take short-lived shared locks that are released as soon as each row has been read, so a reader waits only while a writer holds an exclusive lock on the same row.
The table below shows how major engines realize read committed by default.
| Engine | Default level | Mechanism | Readers block writers |
|---|---|---|---|
| PostgreSQL | Read committed | MVCC with per-statement snapshot | No |
| Oracle Database | Read committed | Undo-based multiversion reads | No |
| SQL Server | Read committed | Shared locks, or row versioning if enabled | Yes, unless versioning is on |
| MySQL InnoDB | Repeatable read | MVCC with fresh snapshot per statement | No |
| IBM Db2 | Cursor stability | Locks held on the current row only | Briefly |
Writes behave differently from reads. Under every implementation, a transaction that updates a row holds an exclusive row lock until commit or rollback, so two concurrent writers to the same row are serialized. In PostgreSQL, the second writer waits, then re-evaluates its WHERE condition against the newly committed row version before applying its change.
Anomalies allowed and prevented
The ANSI SQL standard defines isolation levels by the read phenomena they rule out, and read committed rules out only the first one. Understanding exactly which anomalies remain possible is the key to using the level safely.
| Anomaly | Possible | What happens |
|---|---|---|
| Dirty read | No | Uncommitted data from other transactions is never visible |
| Non-repeatable read | Yes | Rereading a row can return a newly committed value |
| Phantom read | Yes | A repeated range query can return new or missing rows |
| Lost update | Yes | Read-modify-write cycles can overwrite a concurrent change |
| Write skew | Yes | Two transactions break a constraint spanning several rows |
The lost update case deserves special attention because it silently corrupts data. If two sessions both read a balance of 100, each adds 10 in application code and writes back 110, one increment disappears. Read committed does not detect this, because each individual read and write was valid at the moment it ran.
Read committed compared with other isolation levels
Read committed is a middle ground between speed and consistency, and the right comparison depends on whether the workload values throughput or strict correctness. The following table places it among the standard levels and snapshot isolation.
| Isolation level | Snapshot scope | Main anomalies remaining | Relative overhead |
|---|---|---|---|
| Read uncommitted | None | Dirty reads and all others | Lowest |
| Read committed | Per statement | Non-repeatable reads, phantoms, lost updates | Low |
| Repeatable read | Per transaction | Phantoms in some engines, write skew | Moderate |
| Snapshot isolation | Per transaction | Write skew | Moderate |
| Serializable | Per transaction with conflict checks | None | Highest |
A practical difference with stricter levels is error behavior. Under repeatable read or serializable, engines abort conflicting transactions with serialization failures that the application must retry. Read committed almost never raises such errors, which keeps application code simple but shifts responsibility for correctness to the developer.
Using read committed safely in applications
Read committed is safe for most workloads when developers protect read-modify-write sequences explicitly. The level is well suited to short transactions, single-statement updates and reporting queries that tolerate data changing between statements.
The decision table below lists common situations and the technique that closes the gap left by the level.
| Situation | Recommended technique | Reason |
|---|---|---|
| Incrementing a counter | Atomic UPDATE expression | SET n = n + 1 is evaluated on the latest row |
| Editing a record in a form | Optimistic locking with a version column | Detects concurrent edits at write time |
| Reserving scarce stock | SELECT … FOR UPDATE | Locks rows until commit |
| Multi-row business rule | Serializable for that transaction | Prevents write skew |
| Long consistent report | Repeatable read or snapshot | Gives one view for every query |
Developers should also remember that isolation is set per transaction or session. A connection pool may hand out sessions with different settings if code changes the level with SET TRANSACTION and forgets to restore it, so the level is best declared explicitly at transaction start.
Common misconceptions and failure modes
Several recurring misunderstandings cause subtle production bugs under read committed. Most of them come from assuming that a transaction sees a single frozen state of the database.
- A transaction is not a snapshot: two queries inside one read committed transaction can disagree, for example a total and its detail rows.
- Checking then inserting is unsafe: a SELECT that finds no duplicate does not stop another session from inserting one; only a unique constraint guarantees uniqueness.
- Same name, different behavior: SQL Server without row versioning lets readers wait on writers, while PostgreSQL readers never wait, so performance tuning does not transfer directly.
- Retries are rarely automatic: because few errors are raised, missing protection against lost updates often goes unnoticed until audits reveal inconsistent totals.
In plain words
Read committed is a rule that says: you only see finished work. If someone else is halfway through changing a record, you keep seeing the old version until they save. Once they save, your next look shows the new version.
Think of a shared spreadsheet where edits appear only after the editor presses save. You never see half-typed numbers, but if you look at the same cell twice, it may have changed between your glances. The key takeaway is that read committed stops you from seeing unfinished changes, but it does not freeze the data for you while you work.
A real-world example
An online ticketing service runs on PostgreSQL with the default read committed level. During a concert presale, about 2,000 checkout requests per second compete for the last seats in a section. The original code read the seat status with a plain SELECT, checked it in the application and then updated it, and testing under load showed that the same seat was occasionally sold twice.
The team kept read committed for its throughput but changed the checkout to SELECT … FOR UPDATE on the seat row, so a second buyer waits until the first transaction commits and then sees the seat as taken. The result was zero double bookings in the next presale, with median checkout latency rising by only a few milliseconds, far less than switching the whole system to serializable would have cost.