MySQL Glossary

55 阅读4分钟

READ UNCOMMITTED

我的翻译:

这个隔离级别提供了事务间最小程度的保护。查询使用了一种锁策略:允许查询在等待其他事务时继续执行的状态。

但是, 额外表现是引发了更少的可靠结果,包括已经被其他事务更改或还没提交的数据(被认为脏读)。

抱有巨大谨慎使用该隔离级别,且意识到结果可能不是一致或可再生的, 这取决于其他事务是否在同一时间做了操作。通常, 用了该隔离级别的事务只做查询,而不是增删改操作。

有道翻译:

在事务之间提供最少保护的隔离级别。查询采用了一种锁定策略,允许它们在通常需要等待另一个事务的情况下继续进行。然而,这种额外的性能是以较不可靠的结果为代价的,包括已被其他事务更改且尚未提交的数据(称为脏读)。要非常谨慎地使用此隔离级别,并注意,根据同时执行的其他事务的不同,结果可能不一致或不可复制。通常,具有此隔离级别的事务只执行查询,而不执行插入、更新或删除操作。

The isolation level that provides the least amount of protection between transactions. Queries employ(雇佣,使用,利用) a locking strategy that allows them to proceed in situations where they would normally wait for another transaction.

However, this extra performance comes at the cost of less reliable results, including data that has been changed by other transactions and not committed yet(known as dirty read).

Use this isolation level with great caution, and be aware that the results might not be consitent or reproducible(可再生的), depending on what other transactions are doing at the same time. Typically(通常), transactions with this isolation level only do queries, not insert, update, or delete operations.

See Also ACID, dirty read, isolation level, locking, transaction.

REPEATABLE READ

我的翻译:

InnoDB默认的隔离级别。它防止了任何查出来的行被其他事务更改,因此锁住了不可重复读但不是幻读。

它适度地使用了1种严厉的锁的策略所以在1个事务内的所有查询查看了相同快照,也就是说,数据还是事务一开始的时候。

​ 当用了该隔离级别的事务执行了UPDATE ... WHERE, DELETE ... WHERE, SELECT ... FOR UPDATE, and LOCK IN SHARE MODE的操作, 其他事务可能不得不等待。

有道翻译:

​ InnoDB的默认隔离级别。它防止被查询的任何行被其他事务更改,因此阻止了不可重复读取,但没有阻止幻像读取。它使用一种适度严格的锁定策略,以便事务中的所有查询都能看到来自同一快照的数据,即事务开始时的数据。

​ 当具有此隔离级别的事务执行UPDATE…,删除…在那里,选择…对于UPDATE和LOCK IN SHARE模式操作,其他事务可能必须等待。

​ The default isolation level for InnoDB. It prevents any rows that are queried from being changed by other transactions, thus(因此) blocking non-repeatable reads but not phantom reads. It uses a moderately(适度地) strict locking strategy so that all queries within a transaction see data from the same snapshot, that is, the data it was at the time the transaction started.

​ When a transaction with this isolation level performs UPDATE ... WHERE, DELETE ... WHERE, SELECT ... FOR UPDATE, and LOCK IN SHARE MODE operations, other transactions might have to wait.

​ See Also ACID, consistent read, isolation level, locking, phantom, transaction.

MVCC

我的翻译:

​ MVCC是"多版本并发控制"的缩写。这个技术让带有特定隔离级别的InnoDB的事务执行一致性读操作; 也即查出正在被其他事务更新的行和看到这些更改发生之前的值。 这是1个增加并发性的强力技术,通过允许不用等待被其他事务持有的锁的查询行进来实现。

有道翻译:

​ “多版本并发控制”的缩写。该技术允许具有特定隔离级别的InnoDB事务执行一致的读操作;也就是说,查询正在被其他事务更新的行,并查看更新发生之前的值。这是一种增强并发性的强大技术,它允许查询继续进行,而无需由于其他事务持有的锁而等待。

​ 这种技术在数据库领域并不通用。其他一些数据库产品和其他一些MySQL存储引擎不支持它。

​ Acronym for "multiversion concurrency control". This technique lets InnoDB transactions with certain isolation levels perform consistent read operations; that is, to query rows that are being updated by other transactions, and see the values from before those updates occurred. This is a powerful technique to increase concurrency, by allowing queries to proceed without waiting due to locks held by the other transactions.

​ This technique is not universal in the database world. Some other database products, and some other MySQL storage engines, do not support it.

​ See Also ACID, concurrency, consistent read, isolation level, lock, transaction.