InnoDB Read-Only Transactions_只读事务
As of（自从） MySQL 5.6.4, InnoDB can avoid the overhead associated with setting up the transaction ID (TRX_ID field) for transactions that are known to be read-only. A transaction ID is only needed for a transaction that might perform write operations or locking reads such as SELECT ... FOR UPDATE. Eliminating（排除） unnecessary transaction IDs（不必要的transaction id） reduces（降低） the size of internal data structures that are consulted（商量，顾及） each time a query or DML（数据操纵语言） statement constructs a read view.
Currently, InnoDB detects（发现，发觉） read-only transactions when:
The transaction is started with the START TRANSACTION READ ONLY statement. In this case, attempting to make changes to the database (for InnoDB, MyISAM, or other types of tables) causes an error, and the transaction continues in read-only state:
ERROR 1792 (25006): Cannot execute statement in a READ ONLY transaction.
You can still make changes to session-specific temporary（临时的） tables in a read-only transaction, or issue locking queries for them, because those changes and locks are not visible to any other transaction.
The autocommit setting is turned on（打开）, so that the transaction is guaranteed to be a single statement, and the single statement making up the transaction is a “non-locking” SELECT statement. That is, a SELECT that does not use a FOR UPDATE or LOCK IN SHARED MODE clause.
The transaction is started with the START TRANSACTION READ ONLY statement.
The autocommit setting is turned on（打开）.
Thus, for a read-intensive（加强的，强烈的） application such as a report generator, you can tune （调整使协调）a sequence of InnoDB queries by grouping them inside START TRANSACTION READ ONLY and COMMIT, or by turning on the autocommit setting before running the SELECT statements, or simply by avoiding any DML statements interspersed（散开的） with the queries.