|
@@ -41,7 +41,7 @@ T2: UPDATE account
|
|
|
WHERE client = 'Smith'
|
|
|
```
|
|
|
|
|
|
-#### Execution with lost UPDATE
|
|
|
+#### Update Loss
|
|
|
As the name states, one or more changes to the data are lost.
|
|
|
The error is produced by:
|
|
|
- R1 R2 W1 W2
|
|
@@ -105,9 +105,9 @@ T1: C=AVG(B:A=1)
|
|
|
T2: Insert (A=1,B=2)
|
|
|
T1: C=AVG(B: A=1)
|
|
|
```
|
|
|
+## Concurrency Control
|
|
|
|
|
|
-### Schedule
|
|
|
-Sequence of input/output operations performed by concurrent transactions.
|
|
|
+__Schedule__: Sequence of input/output operations performed by concurrent transactions.
|
|
|
es:
|
|
|
>S<sub>1</sub>: r<sub>1</sub>(x) r<sub>2</sub>(z) w<sub>1</sub>(x) w<sub>2</sub>
|
|
|
r<sub>1</sub>,w<sub>1</sub>
|
|
@@ -115,14 +115,15 @@ r<sub>1</sub>,w<sub>1</sub>
|
|
|
$r_1,w_1\in T_1$
|
|
|
$r_2,w_2\in T_2$
|
|
|
|
|
|
-#### Principles of Concurrent Control
|
|
|
+### Principles of Concurrency Control
|
|
|
- __Goal__: to reject schedules that cause anomalies
|
|
|
- __Scheduler__: component that accepts or rejects the operations requested by the transactions
|
|
|
- __Serial schedule__: the actions of each transaction occur in contiguous sequences
|
|
|
- __Serializable schedule__: Produces the same results as some serial schedule on the same transactions (by *schedule equivalence*)
|
|
|
- The class of acceptable schedules produced by a scheduler depends on the cost of equivalence checking, because scheduling must happen in real-time and the more is optimized my sheduling the more computational power I will need to obtain it.
|
|
|
-## CSR and VSR
|
|
|
-$CSR\subset VSR$
|
|
|
+### Concurrency Control techniques:
|
|
|
+- __Theoretical__: CSR and VSR, $CSR\subset VSR$
|
|
|
+- __Practical__: 2PL, 2PL Strict, TS Mono, TS Multi
|
|
|
### View-serializability
|
|
|
###### NOTE: what is a read-from operation?
|
|
|
- $r_i(x)$ *reads-from* $w_j(x)$ in a schedule S when $w_j(x)$ precedes $r_i(x)$ in S and there is no $w_k(x)$ between $r_i(x)$ and $w_j(x)$ in S
|