Difficulty: Easy
Correct Answer: Correct
Explanation:
Introduction / Context:Locking granularity affects concurrency and overhead. Finer granularity (row) increases concurrency but may require more locks; coarser granularity (table) reduces overhead but can block more operations. This question checks the definition of “lock granularity.”
Given Data / Assumptions:
Concept / Approach:“Granularity” literally describes the size or scope of a lockable unit. Databases often support hierarchical locking with intent locks to combine coarse and fine-grained locks safely. Tuning granularity is a trade-off between throughput and overhead.
Step-by-Step Solution:
Recognize possible lock scopes: row, page, table.Relate “granularity” to these scopes.Conclude that lock granularity is the size/scope of the locked resource.Verification / Alternative check:Examine DBMS documentation for lock modes and levels; they explicitly refer to lock levels as granularity choices.
Why Other Options Are Wrong:
Common Pitfalls:Assuming finer granularity is always better. More locks mean more overhead and potential deadlock complexity.
Final Answer:Correct
Discussion & Comments