1. Gyanastra
  2. Database Systems
  3. Schedules and Serializability
  4. Serial Schedules
Free lesson, no account needed 5 min read 2 practice questions after it

Database Systems · Schedules and Serializability

Serial Schedules

Overview

A serial schedule runs one transaction completely before the next one starts, with no interleaving of operations. Serial schedules are always correct but can be slow, so the goal is to find concurrent schedules that are equivalent to serial ones.

Key concepts

  • Serial schedule: a schedule in which one transaction is allowed to complete fully before the next transaction is started; there is no interleaving of operations between transactions.
  • Two serial schedules for T1 and T2:
    1. T1 followed by T2 — all operations of T1 execute first; only after T1 finishes does T2 start.
    2. T2 followed by T1 — all operations of T2 execute first; only after T2 finishes does T1 start.
  • In both cases one transaction is completely over before the other begins, so both are serial schedules.
  • Correctness: serial schedules are guaranteed to be correct because one transaction is not mixed with another — one finishes completely, then the next starts.
    There is no interference between transactions, so they always lead to correct results.
  • Performance problem: performance may be hurt.
    Some operations may be I/O operations; if the system waits for an I/O operation to complete before starting the next transaction, the CPU and other resources may remain idle, leading to performance issues.
  • Goal: even though serial schedules are correct, it is not always desirable to execute only serial schedules.
    The system should execute schedules in which some concurrency is allowed, such that performance is not hurt and the final result is still correct.
    To achieve this, find the schedules that are equivalent to serial schedules and execute those; the rules for identifying such schedules are studied later.

How it works

  1. Take the transactions to be executed (for example, T1 and T2).
  2. Choose an order: run all operations of T1 first, then all operations of T2 (T1 followed by T2), or the reverse (T2 followed by T1).
  3. Do not interleave operations of the two transactions: the first transaction must finish completely before the second starts.
  4. The result is correct because there is no interference between transactions.
  5. Check the cost: if the running transaction waits on an I/O operation, the CPU and other resources may stay idle until it completes, so performance may be poor.
  6. Instead of always running serial schedules, run schedules that allow some concurrency but are equivalent to serial schedules, so that performance is not hurt and the final result is still correct.

Comparison

Schedule typeInterleaving of transactionsCorrectnessPerformance
Serial scheduleNo interleaving; one transaction completes before the next startsAlways correctMay be poor because of waiting, especially for I/O operations
Concurrent schedule with allowed interleavingOperations of different transactions may be interleavedCorrect only if equivalent to a serial scheduleCan improve performance by reducing waiting

Two serial schedules for T1 and T2

Shows the two possible serial orders for two transactions, each running one transaction completely before the other starts.

Worked examples

For two transactions T1 and T2, the serial schedules are:

  • T1 followed by T2: all operations of T1 execute first; only after T1 finishes does T2 start.
  • T2 followed by T1: all operations of T2 execute first; only after T2 finishes does T1 start.

In both, one transaction is completely over before the other begins, so both are serial schedules and both give correct results.

Revision summary

  • A serial schedule has no interleaving: one transaction completes fully before the next starts.
  • For two transactions T1 and T2 there are exactly two serial schedules: T1 then T2, and T2 then T1.
  • Serial schedules always give correct results.
  • The disadvantage of serial schedules is poor performance.
  • Waiting for I/O operations to finish before starting the next transaction can hurt performance, leaving the CPU and other resources idle.
  • Do not always execute serial schedules; execute schedules that allow some concurrency but are equivalent to serial schedules.
  • A concurrent schedule is correct only if it is equivalent to a serial schedule.
  • The rules for finding schedules equivalent to serial schedules are covered later.

Previous-year exam insights

  • For n transactions there are n! possible serial schedules (not just two);
    the two-order case is only for n = 2.
  • A schedule is serializable if it is conflict-equivalent (or view-equivalent) to some serial schedule; serializability is the standard correctness criterion for concurrent schedules, not just 'equivalence' in general.
  • Conflict-serializability is tested by drawing the precedence (serialization) graph: an edge Ti → Tj is added when an operation of Ti conflicts with a later operation of Tj (conflict = same data item, different transactions, at least one write);
    the schedule is conflict-serializable iff the graph has no cycle.
  • Conflict-serializable implies view-serializable, but not conversely; view-serializability is a weaker (more permissive) criterion and is not efficiently decidable in general.
  • Serial schedules are a special case of serializable schedules: every serial schedule is trivially serializable, but a serializable schedule need not be serial.
  • A schedule that is not serializable may still be recoverable or cascadeless; recoverability (no dirty reads committed) and cascadelessness are separate properties from serializability.
Pages 1–2 of 2