Sobes.tech
Junior — Middle

What is the time complexity of deleting elements from a list?

sobes.tech AI

Answer from AI

The transaction isolation level Repeatable Read guarantees that if a transaction reads data, subsequent reads within the same transaction will see the same data, preventing non-repeatable reads.

In practice, this means:

  • The transaction sees the same data on repeated reads.
  • Other transactions cannot modify or delete rows read by the current transaction until it finishes.
  • However, phantom reads (new rows matching the query condition appearing) can still occur if the database does not additionally protect against them.

For example, if you run the same SELECT query twice within a transaction at Repeatable Read level, the results will be identical, even if other transactions try to modify the data in between.