DBMS Unit 4 Part 7 Concurrency Control Techniques

Que5.15. Explain the phantom miracle. Concoct a timestamp grounded protocol that avoids the phantom miracle. AKTU 2015- 16, Marks 15 OR Explain the phantom marvels. bandy a timestamp protocol that avoids the phantom marvels. AKTU 2019- 20, Marks 07 Answer Phantom miracle 1. A impasse that’s detected but isn’t really a impasse is called a phantom impasse. 2. In distributed impasse discovery, information about delay- for relationship between deals is transmitted from one garçon to another. 3. still, the necessary information will ultimately be If there’s a impasse. collected in one place and a cycle will be detected. 4. As this procedure will take some time, there’s a chance that one of the deals that hold a cinch will meanwhile have released it; in this case the impasse will no longer live. 2. Suppose that sale U releases an object at garçon X and requests the bone
held by V at garçonY. 3. Suppose also that the global sensor receives garçon Y’s original graph before garçon X’s. 4. In this case, it would descry a cycle T U V T, although the edge T U no longer exists. 5. A phantom impasse could be detected if a staying sale in a impasse cycle aborts during the impasse discovery procedure. For illustration, if there’s a cycle T U V T and U aborts after the information concerning U has been collected, also the cycle has been broken formerly and there’s no impasse. Timestamp grounded protocol that avoids phantom miracle 1. The B tree indicator grounded approach can be acclimated to timestamping by treating indicator pails as data particulars with timestamps associated with them, and taking that all read accesses use an indicator. 2. Suppose a sale Ti wants to pierce all tuples with a particular range of hunt- key values, using a B tree indicator on that hunt- key. 3. Ti will need to read all the pails in that indicator which have crucial values in that range. 4. Ti will need to write one of the pails in that indicator when any omission or insertion operation on the tuple is done. 5. therefore the logical conflict is converted to a conflict on an indicator pail, and the phantom miracle is avoided. Que5.16. What do you mean by multiple granularities? How it is enforced in sale system? Answer Multiple granularity 1. Multiple granularity can be defined as crescively breaking up the database into blocks which can be locked. 2. It maintains the track of what to lock and how to lock. 3. It makes easy to decide either to lock a data item or to unleash a data item. perpetration 1. Multiple granularity is enforced in sale system by defining multiple situations of granularity by allowing data particulars to be of colorful sizes and defining a scale of data granularity where the small granularities are nested within larger bones
. 2. In the tree, a non splint knot represents the data associated with its descendents. 3. Each knot is an independent data item. 4. The loftiest position represents the entire database. 5. Each knot in the tree can be locked collectively using participated or exclusive mode cinches. 6. still, unequivocal locking is being done at If a knot is locked in an intention mode. lower position of the tree( that is, at a finer granularity). 7. Intention cinches are put on all the ancestors of a knot before that knot is locked explicitly. 8. While covering the tree, the sale locks the colorful bumps in an intention mode. This scale can be represented graphically as a tree. 9. When a sale locks a knot, it also has implicitly locked all the descendents of that knot in the same mode. Que35.17. What’s multiple granularity protocol of concurrency control? Answer 1. Multiple granularity protocol is a protocol in which we lock the data particulars in top-down order and unleash them in bottom- up order. 2. In multiple granularity locking protocol, each sale Ti can lock a knot Q in any locking mode by following certain rules, which ensures serializability. These rules are as follows Ti must follow the comity matrix as shown inFig.5.17.1 to lock a knot Q. This matrix contain following fresh cinches Intension- Shared( IS) unequivocal locking at a lower position of tree but only with participated cinches. Intension-Exclusive( IX) unequivocal locking at a lower position with exclusive or participated cinches. Shared and Intension- Exclusive( SIX) Thesub-tree embedded by that knot is locked explicitly in participated mode and unequivocal locking is being done at a lower position with exclusive mode cinches. ii. It first locks the root of the tree and also locks the other bumps. iii. It can lock a knot Q in S or IS mode only if it presently has the parent of Q locked in either IX or IS mode. iv. It can lock knot Q in X, SIX or IX mode only if it presently has the parent of Q locked in either IX or SIX mode. v. It can lock a knot if it has not preliminarily uncorked any knot. vi. It can unleash a knot Q only if it presently has none of the children of Q locked. Que5.18. What’s granularity locking? How does granularity of data item affect the performance of concurrency control? What factors affect the selection of granularity size of data item? Answer Granularity locking 1. Granularity locking is a conception of locking the data item on the base of size of data item. 2. It’s grounded on the scale of data where small granularities are nested within larger bone
. The cinch may be granted at any position from bottom to top. Effect of granularity of data item over the performance of concurrency control 1. The larger the data item size is, the lower the degree of concurrency permitted. For illustration, if the data item size is fragment block, a sale T that need to lock a record B must lock the whole fragment block X that contains B. If the other deals want to lock record C which resides in same cinch also it’s forced to stay. 2. If the data item size is small also the number of particulars in the database increases. Because every item is associated with a cinch, the system will have a larger number of active cinches to be handled by the cinch director. 3. further cinch and unlock operations will be performed which beget advanced outflow. Factors affecting the selection of granularity size of data particulars 1. It depends on the types of sale involved. 2. still, it is If a typical sale accesses a small number of records. profitable to have the data item granularity be one record. 3. still, it may If a sale generally accesses numerous records in the same train. be better to have block or train granularity so that the sale will consider all those records as one( or a many) data particulars. Que5.20. What’s multiversion concurrency control? Explain multiversion timestamping protocol. Answer Multiversion concurrency control 1. Multiversion concurrency control is a schemes in which each write( Q) operation creates a new interpretation ofQ. 2. When a sale issues a read( Q) operation, the concurrency- control director selects one of the interpretation of Q to be read. 3. The concurrency control scheme must insure that the interpretation to be read is named in manner that ensures serializability. Multiversion timestamping protocol 1. The most common sale- ordering fashion used by multiversion schemes is timestamping. 2. With each sale Ti in the system, we associate a unique static timestamp, denoted by TS( Ti). 3. This timestamp is assigned before the sale starts prosecution. 4. Concurrency can be increased if we allow multiple performances to be stored, so that the sale can pierce the interpretation that’s harmonious for them. 5. With this protocol, each data item Q is associated with a sequence of performances< Q1, Q2,…, Qm>. 6. Each interpretation Qk contains three data fields Content is the value of interpretation Qk. W- timestamp( Qk) is the timestamp of the sale that created interpretation Qk. R- timestamp( Qk) is the largest timestamp of any sale that successfully read interpretation Qk. 7. The scheme operates as follows Suppose that sale Ti issues a read( Q) operation. Let Qk denote the interpretation of Q whose write timestamp is the largest write timestamp lower than or equal to TS( Ti). , also the value returned is the If sale Ti issues a read( Q). content of interpretation Qk. b. When sale Ti issues write( Q) , also the system rolls back If TS( Tj)< R- timestamp( Qk). sale Ti. , the system overwrites the If TS( Ti) = W- timestamp( Qk). contents of Qk; else it creates a new interpretation ofQ. iii. This rule forces a sale to repeal if it’s “ too late ” in doing a write.

Leave a Comment