nerdexam
Oracle

1Z0-873 · Question #49

Which of the following describes how READ LOCAL locking works?

The correct answer is B. It locks a table for reading but allows concurrent inserts. Locks a table for reading, but allows concurrent inserts. A concurrent insert is an exception to the "readers block writers" principle. It applies only to MyISAM tables. If a MyISAM table has no holes in the middle resulting from deleted or updated records, inserts always take…

MySQL Locking

Question

Which of the following describes how READ LOCAL locking works?

Options

  • AIt locks a table for reading only by connections on localhost.
  • BIt locks a table for reading but allows concurrent inserts.
  • CIt locks a table for writing, preventing reads until it is released.

How the community answered

(50 responses)
  • A
    12% (6)
  • B
    80% (40)
  • C
    8% (4)

Explanation

Locks a table for reading, but allows concurrent inserts. A concurrent insert is an exception to the "readers block writers" principle. It applies only to MyISAM tables. If a MyISAM table has no holes in the middle resulting from deleted or updated records, inserts always take place at the end of the table. In that case, a client that is reading from a table can lock it with a READ LOCAL lock to allow other clients to insert into the table while the client holding the read lock reads from it. If a MyISAM table does have holes, you can remove them by using OPTIMIZE TABLE to defragment

Topics

#READ LOCAL lock#concurrent inserts#table locks#MyISAM

Community Discussion

No community discussion yet for this question.

Full 1Z0-873 Practice