mirror of
https://github.com/kristoferssolo/Databases-II-Cheatsheet.git
synced 2025-10-21 18:20:35 +00:00
Merge branch 'jorenchik-main'
This commit is contained in:
commit
97934dd5ac
BIN
export/DB2Cheatsheet.pdf
Normal file
BIN
export/DB2Cheatsheet.pdf
Normal file
Binary file not shown.
28
main.typ
28
main.typ
@ -87,9 +87,10 @@ Simplified version (to get the idea)
|
|||||||
for each tuple tr in r: (for each tuple ts in s: test pair (tr, ts))
|
for each tuple tr in r: (for each tuple ts in s: test pair (tr, ts))
|
||||||
```
|
```
|
||||||
|
|
||||||
// TODO: Add seek information
|
Block transfer cost: $n_r ∗ b_s + b_r$ block transfers would be required,
|
||||||
Block transfer cost: $n_r dot b_s + b_r$ block transfers would be required,
|
where $b_r$ -- blocks in relation $r$, same for $s$. Each scan of the inner
|
||||||
where $b_r$ -- blocks in relation $r$, same for $s$.
|
relation requires one seek, and the scan of the outer relation requires one
|
||||||
|
seek per block, leading to a total of $2 ∗b_r$ seeks.
|
||||||
|
|
||||||
== Block-nested join
|
== Block-nested join
|
||||||
|
|
||||||
@ -275,7 +276,8 @@ The concept of conflict equivalence leads to the concept of conflict
|
|||||||
serializability. We say that a schedule $S$ is *conflict serializable* if it is
|
serializability. We say that a schedule $S$ is *conflict serializable* if it is
|
||||||
conflict equivalent to a serial schedule.
|
conflict equivalent to a serial schedule.
|
||||||
|
|
||||||
=== Serializability graph
|
// TODO: rename to precedence
|
||||||
|
=== Precedence graph
|
||||||
|
|
||||||
Simple and efficient method for determining the conflict seriazability of a
|
Simple and efficient method for determining the conflict seriazability of a
|
||||||
schedule. Consider a schedule $S$. We construct a directed graph, called a
|
schedule. Consider a schedule $S$. We construct a directed graph, called a
|
||||||
@ -304,11 +306,19 @@ serializable.
|
|||||||
|
|
||||||
== Protocols
|
== Protocols
|
||||||
|
|
||||||
We say that a schedule S is *legal* under a given locking protocol if S is a
|
We say that a schedule S is *legal* under a given locking protocol if S is a possible
|
||||||
possible schedule for a set of transactions that follows the rules of the
|
schedule for a set of transactions that follows the rules of the locking protocol. We say
|
||||||
locking protocol. We say that a locking protocol ensures conflict
|
that a locking protocol ensures conflict serializability if and only if all legal schedules
|
||||||
serializability if and only if all legal schedules are *conflict serializable*;
|
are *conflict serializable*; in other words, for all legal schedules the associated →relation
|
||||||
in other words, for all legal schedules the associated $->$ relation is acyclic.
|
is acyclic.
|
||||||
|
\ *Recoverable* schedule is one where, for each pair of transactions $T_i$ and
|
||||||
|
$T_j$ such that $T_j$ reads a data item previously written by $T_i$, the commit
|
||||||
|
operation of $T_i$ appears before the commit operation of $T_j$.
|
||||||
|
\ *Cascadeless* schedule is one where, for each pair of transactions $T_i$ and
|
||||||
|
$T_j$ such that $T_j$ reads a data item previously written by $T_i$, the commit
|
||||||
|
operation of $T_i$ appears before the read operation of $T_j$.
|
||||||
|
Every cascadeless schedule is also recoverable.
|
||||||
|
|
||||||
|
|
||||||
=== Lock-based
|
=== Lock-based
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user