Schedules in DBMS - Types of Schedules in DBMS
Schedules in DBMS - Types of Schedules in DBMS
Watch on
Spread the love
Schedules in DBMS-
Before you go through this article, make sure that you have gone through the previous article on
Transactions in DBMS.
The order in which the operations of multiple transactions appear for execution is called as a schedule.
Types of Schedules-
https://www.gatevidyalay.com/schedules-in-dbms/ 1/12
4/14/24, 10:08 PM Schedules in DBMS | Types of Schedules in DBMS | Gate Vidyalay
Serial Schedules-
In serial schedules,
https://www.gatevidyalay.com/schedules-in-dbms/ 2/12
4/14/24, 10:08 PM Schedules in DBMS | Types of Schedules in DBMS | Gate Vidyalay
Characteristics-
Consistent
Recoverable
Cascadeless
Strict
Example-01:
In this schedule,
There are two transactions T1 and T2 executing serially one after the other.
Transaction T1 executes first.
After T1 completes its execution, transaction T2 executes.
So, this schedule is an example of a Serial Schedule.
https://www.gatevidyalay.com/schedules-in-dbms/ 3/12
4/14/24, 10:08 PM Schedules in DBMS | Types of Schedules in DBMS | Gate Vidyalay
···
Example-02:
In this schedule,
There are two transactions T1 and T2 executing serially one after the other.
Transaction T2 executes first.
After T2 completes its execution, transaction T1 executes.
https://www.gatevidyalay.com/schedules-in-dbms/ 4/12
4/14/24, 10:08 PM Schedules in DBMS | Types of Schedules in DBMS | Gate Vidyalay
Non-Serial Schedules-
In non-serial schedules,
Characteristics-
Consistent
Recoverable
Cascadeless
Strict
Example-01:
https://www.gatevidyalay.com/schedules-in-dbms/ 5/12
4/14/24, 10:08 PM Schedules in DBMS | Types of Schedules in DBMS | Gate Vidyalay
In this schedule,
Example-02:
https://www.gatevidyalay.com/schedules-in-dbms/ 6/12
4/14/24, 10:08 PM Schedules in DBMS | Types of Schedules in DBMS | Gate Vidyalay
In this schedule,
Consider there are n number of transactions T1, T2, T3 …. , Tn with N1, N2, N3 …. , Nn number of
operations respectively.
https://www.gatevidyalay.com/schedules-in-dbms/ 7/12
4/14/24, 10:08 PM Schedules in DBMS | Types of Schedules in DBMS | Gate Vidyalay
= n!
···
https://www.gatevidyalay.com/schedules-in-dbms/ 8/12
4/14/24, 10:08 PM Schedules in DBMS | Types of Schedules in DBMS | Gate Vidyalay
Problem-
Solution-
···
https://www.gatevidyalay.com/schedules-in-dbms/ 9/12
4/14/24, 10:08 PM Schedules in DBMS | Types of Schedules in DBMS | Gate Vidyalay
= 3!
=6
···
= 1260 – 6
= 1254
Get more notes and other study material of Database Management System (DBMS).
https://www.gatevidyalay.com/schedules-in-dbms/ 10/12
4/14/24, 10:12 PM Serializability in DBMS | Conflict Serializability | Gate Vidyalay
Serializability in DBMS-
Serializable Schedules-
If a given non-serial schedule of ‘n’ transactions is equivalent to some serial schedule of ‘n’ transactions,
then it is called as a serializable schedule.
Characteristics-
https://www.gatevidyalay.com/serializability-in-dbms-conflict-serializability/ 3/10
4/14/24, 10:12 PM Serializability in DBMS | Conflict Serializability | Gate Vidyalay
Consistent
Recoverable
Casacadeless
Strict
Thus, all the transactions necessarily execute Thus, multiple transactions can execute
serially one after the other. concurrently.
Serial schedules lead to less resource utilization Serializable schedules improve both resource
and CPU throughput. utilization and CPU throughput.
Serial Schedules are less efficient as compared to Serializable Schedules are always better than
serializable schedules. serial schedules.
···
https://www.gatevidyalay.com/serializability-in-dbms-conflict-serializability/ 4/10
4/14/24, 10:12 PM Serializability in DBMS | Conflict Serializability | Gate Vidyalay
Types of Serializability-
1. Conflict Serializability
2. View Serializability
Conflict Serializability-
If a given non-serial schedule can be converted into a serial schedule by swapping its non-conflicting
operations, then it is called as a conflict serializable schedule.
Conflicting Operations-
Two operations are called as conflicting operations if all the following conditions hold true for them-
Example-
In this schedule,
https://www.gatevidyalay.com/serializability-in-dbms-conflict-serializability/ 6/10
4/14/24, 10:12 PM Serializability in DBMS | Conflict Serializability | Gate Vidyalay
Follow the following steps to check whether a given non-serial schedule is conflict serializable or not-
Step-01:
Step-02:
Start creating a precedence graph by drawing one node for each transaction.
Step-03:
Draw an edge for each conflict pair such that if Xi (V) and Yj (V) forms a conflict pair then draw an
edge from Ti to Tj.
Step-04:
https://www.gatevidyalay.com/serializability-in-dbms-conflict-serializability/ 7/10
4/14/24, 10:12 PM Serializability in DBMS | Conflict Serializability | Gate Vidyalay
···
NOTE-
By performing the Topological Sort of the Directed Acyclic Graph so obtained, the corresponding
serial schedule(s) can be found.
Such schedules can be more than 1.
···
Get more notes and other study material of Database Management System (DBMS).
https://www.gatevidyalay.com/serializability-in-dbms-conflict-serializability/ 8/10