CSE Roadmap

Specialist tier · about 3 hours · 5 parts

Part 2 of 5 · 1 min read

Schedules, serial and interleaved

A schedule is the actual order operations from different transactions execute in; a serial schedule runs each transaction fully before the next.

Think of two separate recipes being followed in one kitchen. A serial schedule finishes recipe one completely before starting recipe two; an interleaved schedule hops back and forth between steps of both recipes.

In plain words: a schedule is the actual sequence of read and write operations, drawn from one or more transactions, in the order they execute. A serial schedule runs one transaction's operations completely, in order, before starting the next transaction's operations, never interleaving the two. A serial schedule is always safe by definition, since there is no concurrency at all to reason about, but running transactions one at a time, with no overlap, sacrifices the whole benefit of concurrency.

A worked example. A serial schedule for two transfers runs the first transfer's debit and credit completely, then starts the second transfer's debit and credit only after the first has fully finished.

The key lines. No new SQL; a schedule is a concept for reasoning about the order of operations across transactions, not something written directly in SQL.

Schedule, serial schedule

A schedule is the actual order in which operations from one or more transactions execute; a serial schedule runs each transaction's operations completely before the next transaction begins, with no interleaving.

Example: finishing one recipe completely before starting a second, with no interleaving of steps, is a serial schedule for those two recipes.