Open In App

Calculation of Serial and Non-Serial Schedules in DBMS

Last Updated : 24 Jan, 2023
Improve
Improve
Like Article
Like
Save
Share
Report

The serial execution of a transaction is defined as Schedule. It is made up of a number of transactions each comprising of a number of instructions. Types of Schedules

  • Serial Schedules
  • Non-Serial Schedules

Calculation of Number of Schedules : Consider there to be n number of transactions t1, t2, t3, …., tN with N1,N2,N3,…..Nn number of operations respectively.

  1. Total Number of Schedules –
(N1 + N2 + N3 + ..... + Nn)! / (N1! * N2! * N3! * ... * Nn!)
  1. Number of Serial Schedules –
It is all possible permutations of n transactions = N!
  1. Number of Non-Serial Schedules – Total Schedules = Serial Schedules + Non-Serial Schedules Number of Non-Serial Schedules = Total Number of Schedules – Number of Serial Schedules
((N1 + N2 + N3 + ..... + Nn)! / (N1! * N2! * N3! * ... * Nn!)) - (N!)

Example – Consider there to be three transactions with 1, 2, and 3 operations respectively. We have to find –

  • Total number of schedules possible.
  • Total number of serial schedules and non-serial schedules possible.

Solution – Total Number of Schedules,

= (1 + 2 + 3)! / (1! * 2! * 3!) = 6! / 12 = 60

Number of Serial Schedules,
= 3! = 6

Number of Non-Serial Schedules,
= Total Number of Schedules - Number of Serial Schedules 
= 60 - 6 
= 54 

Like Article
Suggest improvement
Previous
Next
Share your thoughts in the comments

Similar Reads