How Does MySQL Handle Read Consistency

Q

How Does MySQL Handle Read Consistency? - MySQL FAQs - Transaction Management: Commit or Rollback

✍: FYIcenter.com

A

Read consistency is a concept that describes how consistent the output will be on two subsequent read operations. A read operation is usually a stand alone SELECT statement or a SELECT subquery in a parent statement.

A database server can support up to 3 levels of read consistency:

  • No Read Consistency - Two subsequent read operations will get no consistent output, if other sessions are making changes to the database.
  • Statement-Level Read Consistency - Two subsequent read operations will get consistent output, if they are used as subqueries within a single SQL statement.
  • Transaction-Level Read Consistency - Two subsequent read operations will get consistent output, if they are used as subqueries or SELECT statements within a single transaction.

By default, MySQL server offers the highest level, Transaction-Level Read Consistency, on tables with transaction-safe storage engines, like InnoDB.

2007-05-11, 4966👍, 0💬