https://moodle.cs.ubbcluj.ro/pluginfile.php/49852/mod_resource/content/1/DBMSs_Lecture1.pdf
https://moodle.cs.ubbcluj.ro/pluginfile.php/49928/mod_resource/content/1/DBMSs_Lecture2.pdf
https://moodle.cs.ubbcluj.ro/pluginfile.php/49946/mod_resource/content/1/DBMSs_Lecture3.pdf
Interleaved Executions
- the DBMS interleaves the operations (reads / writes of database objects) of different user programs, as concurrent execution is fundamental for the performance of the application
- the disk is frequently accessed (and access times are relatively slow)
- overlap I/O and CPU activity
- if concurrent execution is allowed, one needs to tackle the effects of interleaving user programs
Consider the two transactions below:
T1: BEGIN A ← A-100 B ← B+100 END
T2: BEGIN A ← 1.05A B ← 1.05B END
- T1 is transferring 100 lei from account A to account B
- T2 is adding 5% interest to both accounts
- T1 and T2 are submitted together to the DBMS
- serial execution:
- T1 can execute before or after T2 on a database DB, resulting in one of the following database states: State( (T1T2), DB) or State( (T2T1), DB)
- interleaved execution:
- the net effect of executing T1 and T2 must be identical to State( (T1 T2), DB) or State( (T2 T1), DB)
Consider the following interleaving of operations (schedule):
T1: BEGIN A ← A-100 B ← B+100 END
T2: BEGIN A ← 1.05A B ← 1.05B END
or
T1: BEGIN A ← A-100 B ← B+100 END