Big Data Systems HPI

Quiz 0 Distributed Systems


Question

Consider a relation R holding information about the employees e in a large organization. Assume that the percentage of young employees (aged below 45) is 97% and the percentage of old employees (45 and above) is 3%.

Let L(e) denote a single lock request, and L(e)... a series of identical lock requests of the lock type L on one or more employee tuples respectively.

For each of the following database operations, select the most efficient sequence of locks to be acquired by the enclosing transaction T. You can assume that the transaction queries use an index on the employee's age to filter out old employees.

*Choices:*
* X(R);
* X(R); X(e)…;
* S(R); X(e)...;
* SIX(R); X(e)...;
* IX(R); X(e)…;
  1. Increase the salary of all young employees by 5%.
  2. Compute the maximum old employee salary SY and reduce the salaries of the young employees when necessary, such that their salary does not exceed SY.
  3. Increase the salary of all old employees by 5%.
  4. Compute the maximum young employee salary SY and reduce the salaries of the old employees when necessary, such that their salary does not exceed SY.

Answer
  1. Increase the salary of all young employees by 5%. → X(R);
  2. Compute the maximum old employee salary SY and reduce the salaries of the young employees when necessary, such that their salary does not exceed SY. → SIX(R);X(e)...;
  3. Increase the salary of all old employees by 5%. → IX(R); X(e)...;
  4. Compute the maximum young employee salary SY and reduce the salaries of the old employees when necessary, such that their salary does not exceed SY. → SIX(R); X(e)...;



Comments