DBMS Notes

Schedules And Its Types

When there are multiple transactions are running and the order of execution is needed then schedules comes into pictures. So that operations do not overlap to each other.

In simple words, schedules define the order of the operation of the each transaction.

Types of Schedules in DBMS

1. Serial Schedules

Schedules in which no transaction can starts until a running transaction is ended are called serial schedules.

Example: Consider the following schedules (A and B) each hold two transactions T1 and T2. In Serial schedule two transactions execute separately. They cannot execute at the same time as given below

This is a serial schedule since the transactions perform serially in the order T1 —> T2  OR T2 —> T1

Advantage of Serial Schedule

Main benefit of serial schedule is that there is no concurrency problem.

Disadvantage of Serial Schedule

 It is time wasting approach because if T1,T2,T3 arrive at same time then T2,T3 has to wait until T1 is completed.

In further lectures we will deal with parallel scheduling, not serial schedule because time is the money.

Concurrency Problem

This problem occurs when two transactions are accessing the same data in such a way that execution of one transaction will affect the other transaction.

2. Non-Serial (Parallel) Schedule

In the non-serial schedule, the other transaction proceeds without waiting for the previous transaction to complete. Non-serial schedule can be of two types

  • Serializable
  • Non-Serializable Schedule.

Example: following schedules are non-serial where T1 and T2 are running concurrently.

  • The operations of T1 and T2 are interleaved.
  • So, the following schedules are an example of a Non-Serial Schedule.

Our Need is parallel transactions because of time saving but parallel cause the Concurrency problem and Read write Conflict problem

Explanation With Real Life Example

  • If there exist one ATM machine then only one person can widraw the money at a time other persons has to wait. It is a serial schedule
  • By using online application of any bank, thousands of people can send and receive the money at a time. It is a parallel schedule

Difference Between Serial & Parallel Schedule

Serial Parallel
Only one transaction execute at a time More than one transaction execute at a time
Less Throughput High Throughput
Low performance High Performance
No concurrency problem Concurrency problem in some cases

 

Help Other’s By Sharing…

Contact Us

Burewala, Vehari, Punjab, Pakistan

cstaleem1@gmail.com

Website: CStaleem.com

Pin It on Pinterest