SQLMentor // glossary

Phantom Read

A phantom read happens when a transaction re-runs the same filtered query twice and gets a different set of rows, because another transaction inserted or deleted rows matching that filter in between.

Unlike a non-repeatable read (a value on an existing row changed), a phantom read is about the row set changing — new rows appearing or existing rows vanishing from the result. Only the strictest standard isolation level, Serializable, fully prevents phantom reads; Repeatable Read prevents changes to rows already read but doesn't always prevent new matching rows from appearing.