Schedules Flashcards
Serial Schedule
- Execute correctly
- Maintain consistency of database
- Inefficient in multi-user environments (transactions will wait for other transactions)
Concurrent Schedules
- may not execute correctly
- may not guarantee consistency
- efficient in multi-user environments
Basic Operations of Transactions
begin
read(X)
write(X)
commit
read(X)
Reads a database item X into program variable (also named X, for simplicity):
- Find address of disk block/page containing item X
- Copy disk block into a buffer in main memory
- Copy item X from buffer to program variable X
write(X)
Writes value of program variable X into database item named X:
- find address of page that contains item X
- Copy disk block into buffer in main memory
- Copy item X from program variable X into its correct location
- Store the updated block from buffer back to disk either immediately or some time later
Serializable Schedules
A schedule S is serializable if there is a serial schedule Sā that has the same effect as S on every initial database state.
Essentially, it is serializable if it is a concurrent schedule that we can change to a serial one without changing the outcome.
Serialisable Schedule ACID Properties
Serializable schedules guarantee correctness and consistency, but does not satisfy isolation (can be fixed).
Conflict-equivalent Schedule
Conflict-equivalent schedules are found when you can get one transaction from another by swapping pairs of non-conflicting operations.
Conflict-serialisable Schedule
A schedule in which is performed in a serial manner would cause conflicts between read and writes of different transactions. It can also be defined as a schedule which is conflict-equivalent to a serial schedule.
Precedence Graph
A directed graph in which the nodes represent the transactions, and is drawn to show the conflicts in the transactions, and used to represent if a group of transactions are conflict-serializable.