在这种情况下,锁定数据库记录有优点也有缺点。
Having the database records locked in this case is a good thing and a bad thing.
尤其是有一两千万行数据的时候,每次修改模式、往数据库中添加索引都会数小时完全锁定数据库。
In particular, making schema changes or adding indexes to a database with more than 10-20 million rows completely locks the database for hours at a time.
与图 1 类似,事务 1(TX1)在读 balance 值 1000 时并没有锁定数据库的行。
Similar to Figure 1, Transaction 1 (Tx1) reads the balance value as 1000 without locking the row in the database.
应用推荐