Jas*_*ker 31 mysql locking table-locking
根据MySQL手册:
对于大型表,表锁定通常比行锁定更好,
Why is this? I would presume that row-level locking is better because when you lock on a larger table, you're locking more data.
DVK*_*DVK 18
Row locking needs more memory than table or page level locking.
Have to acquire many more locks with row locking, which expends more resources
From http://www.devshed.com/c/a/MySQL/MySQL-Optimization-part-2/
Advantages of row-level locking:
Disadvantages of row-level locking:
Table locks are superior to page-level or row-level locks in the following cases:
UPDATE tbl_name SET column=value WHERE unique_key_col=key_value;
DELETE FROM tbl_name WHERE unique_key_col=key_value;