Why would two-phase locking not be an appropriate concurrency control scheme for indexes? Discuss a more appropriate locking scheme for tree-based indexes.
What will be an ideal response?
Concurrency control for an index structure can be managed by treating each page of the index
as a data item and applying the 2PL protocol. However, since indexes are likely to be
frequently accessed, particularly the higher levels of trees (as searching occurs from the root
downwards), this simple concurrency control strategy may lead to high lock contention.
Therefore, a more efficient locking protocol is required for indexes.
Can use the following locking strategy:
(1) For searches, obtain shared locks on nodes starting at the root and proceeding downwards
along the required path. Release the lock on a node once a lock has been obtained on the
child node.
(2) For insertions, a conservative approach would be to obtain exclusive locks on all nodes
as we descend the tree to the leaf node to be modified. This ensures that a split in the leaf
node can propagate all the way up the tree to the root. However, if a child node is not full
the lock on the parent node can be released. A more optimistic approach would be to
obtain shared locks on all nodes as we descend to the leaf node to be modified, where we
obtain an exclusive lock on the leaf node itself. If the leaf node has to split, we upgrade
the shared lock on the parent node to an exclusive lock. If this node also has to split, we
continue to upgrade the locks at the next higher level. In the majority of cases, a split is
not required making this a better approach.
You might also like to view...
Write a SELECT statement to list zipcodes and their cities in New York State sorted by zipcode. (123 rows)
What will be an ideal response?
Members of a SharePoint community site can explore and filter discussions, and gain reputation points for contributions they make to the community site
Indicate whether the statement is true or false
If you are making a pattern of just lines, you need to place a square or rectangle behind the line artwork to define the tile for the line pattern. Which of the following settings should that shape have?
A. fill of None and stroke of Black B. fill of None and stroke of White C. fill of White and stroke of None D. fill of None and stroke of None
The ________ status of a website indicates that the company running the website has a certificate to prove that they own the site
A) encrypted B) authenticated C) phishing D) verified