Why is table-level locking better than row-level locking for large tables?

后端 未结 5 1046
温柔的废话
温柔的废话 2020-12-23 16:51

According to the MySQL manual:

For large tables, table locking is often better than row locking,

Why is this? I would presume

5条回答
  •  情书的邮戳
    2020-12-23 17:20

    A row Table level lock is better for a large table where major data modifications are taking place. This lets the system contend with a single lock on the table rather than having to deal with a gazillion locks (one for each row).

    The RDBMS automatically escalates locking levels internally.

提交回复
热议问题