DELAPARRA
Index
Color
NL
Category: SQL

REPEATABLE READ

Explained by Updated

What is REPEATABLE READ?

REPEATABLE READ: Rows you read once stay the same for the whole transaction. MySQL InnoDB’s default. REPEATABLE READ is a transaction isolation level where rows you have read stay the same for the rest of the transaction. Even if another transaction changes and commits them, you keep seeing the original values. It is the default in MySQL's InnoDB engine. InnoDB gives each transaction a consistent snapshot, which also prevents most phantom reads for normal queries.

Definition source Coders Lingo, CC BY 4.0

Frequently asked questions about REPEATABLE READ

What should you keep in mind with REPEATABLE READ?

It makes reports and multi-step reads consistent. It does not stop two transactions from both reading a value and then both writing based on it. For that, you still need SELECT ... FOR UPDATE, atomic updates or unique constraints. Long transactions at this level also keep old row versions around, which costs resources, so keep them short.

What does an example of REPEATABLE READ look like?

SET TRANSACTION ISOLATION LEVEL REPEATABLE READ;

At a glance

CategorySQL
Explained by
Updated

More SQL terms

All terms starting with R

Skills

Download all skills (zip)

Manuals

Related services

Need any help?

Stuck on one of these in your own project? Tell me what you are working on and I will tell you how I would approach it.