A lost update overwrites an earlier write derived from a stale read.

highlighted = computed this step

Lost update

A lost update occurs when two transactions read the same item and both try a read-modify-write update. The later write overwrites the earlier intent. Note: the render shows the trace order, not just the final cell.

lost update\text{lost update}

Both transactions read

The compiled trace has 2 reads before the writes finish. Note: both reads are stale bases for separate update intents.

reads=2\text{reads}=2

these traces model specific anomalies under a read-latest-write execution model; isolation levels (RC/RR/SI/serializable) and MVCC mechanism are modelled later - no product claims.

anomaly: lost_update; final: X=120; serial: X=120stepT1T20R(X)=1001R(X)=1002W(X,110)3W(X,120)

Overwrite

Transaction T1 wrote 110; transaction T2 overwrote it. The lost write value is 110 and the final state has 1 item. Note: the final value appears in the render, not in prose.

lost value=110,overwriter=T2\text{lost value}=110,\quad \text{overwriter}=T2

these traces model specific anomalies under a read-latest-write execution model; isolation levels (RC/RR/SI/serializable) and MVCC mechanism are modelled later - no product claims.

anomaly: lost_update; final: X=120; serial: X=120stepT1T20R(X)=1001R(X)=1002W(X,110)3W(X,120)

Final state can look harmless

The interleaved final value is 120 and the serial baseline value is 120; the match flag is yes. Note: this is why the lesson reads the trace intent, not only the final table.

final=120,serial=120\text{final}=120,\quad \text{serial}=120

these traces model specific anomalies under a read-latest-write execution model; isolation levels (RC/RR/SI/serializable) and MVCC mechanism are modelled later - no product claims.

anomaly: lost_update; final: X=120; serial: X=120stepT1T20R(X)=1001R(X)=1002W(X,110)3W(X,120)
anomaly: no_anomaly; final: X=120; serial: X=120stepT1T20R(X)=1001W(X,110)2R(X)=1103W(X,120)

Summary

Lost update is an overwrite anomaly caused by interleaved read-modify-write work. The important point is intent, not only final state. This trace ends at a value that the serial baseline also produces, so the final state alone looks harmless. The anomaly is that one read-modify-write intent was silently discarded: two writes were derived from the same stale read, and only one derived update survives. Write skew is different: no write is lost; a cross-item constraint breaks instead. Note: isolation levels, serializable behavior, and MVCC mechanisms are deferred to later books.

overwrite anomaly\text{overwrite anomaly}