READ ONLY TRANSACTIONS

During a read-only transaction, all queries refer to the same snapshot of the database***, providing a multi-table, multi-query, read-consistent view. Other users can continue to query or update data as usual. A commit or rollback ends the transaction. eg: a store manager uses a read-only transaction to gather order totals for the day, the past week, and the past month. The totals are unaffected by other users updating the database during the transaction.

command:

SET TRANSACTION READ ONLY;