- Trending Categories
- Data Structure
- Operating System
- C Programming
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
What are the different types of schedules in DBMS?
A schedule is defined as an execution sequence of transactions. A schedule maintains the order of the operation in each individual transaction. A schedule is the arrangement of transaction operations. A schedule may contain a set of transactions. We already know that a transaction is a set of operations. To run transactions concurrently, we arrange or schedule their operations in an interleaved fashion.
Schedules are divided into 2 categories, which are as follows −
- Serial Schedule
- Non-serial Schedule
The categories of schedules are given below in a form of chart −
Transactions present in this schedule are executed serially, after the instruction of Ti completes, the instructions of Tj will be executed, where j=i+1.
Serial schedule guarantee consistency −
For 2 transactions, total number of serial schedules possible = 2.
For 3 transactions, total number of serial schedules possible = 6.
2 Transaction 3 Transaction T1->T2 T1->T2->T3 T2->T1 T1->T3->T2 T2->T1->T3 T2->T3->T1 T3->T1->T2 T3->T2->T1
If n = number of transactions, then number of serial schedules possible = n!.
A serial schedule always gives the correct result. But, we follow a concurrent schedule for time efficiency. So we must ensure serializability of a concurrent schedule.
When a transaction is overlapped between the transactions T1 and T2.
Types of Non serial schedules
Non serial schedules are divided into serializability and the Non serial schedules. Let us first discuss serializability.
There are two types of serializability which are as follows −
A schedule is view-serializability if it is view equivalent to a serial schedule.
The rules it follows are given below −
T1 is reading the initial value of A, and then T2 also reads the initial value of A.
T1 is the reading value written by T2, and then T2 also reads the value written by T1.
T1 is writing the final value, and then T2 also has the write operation as the final value.
It orders any conflicting operations in the same way as some serial execution. A pair of operations is said to conflict if they operate on the same data item and one of them is a write operation.
Readi(x) readj(x) - non conflict read-read operation
Readi(x) writej(x) - conflict read-write operation.
Writei(x) readj(x) - conflict write-read operation.
Writei(x) writej(x) - conflict write-write operation.
The Non serial schedules are divided into recoverable and non-recoverable schedules. Let us first understand the recoverable schedule.
Consider the following example −
Here, transaction T2 is reading the value written by transaction T1 and the commit of T2 occurs after the commit of T1. Hence, it is a recoverable schedule.
Again the recoverable schedule is divided into cascade less and strict schedule −
- Cascadeless schedule
Given below is an example for the cascadeless schedule −
Here, the updated value of X is read by transaction T2 only after the commit of transaction T1. Hence, the schedule is Cascadeless schedule.
- Strict schedule
Given below is an example of strict schedule −
Here, transaction T2 reads and writes the updated or written value of transaction T1 only after the transaction T1 commits. Hence, the schedule is strict schedule.
Now let us see about the Non-recoverable schedule.
A schedule that is not recoverable is non-recoverable. If the commit operation of Ti doesn't occur before the commit operation of Tj, it is non-recoverable.
Consider an example for the non-recoverable schedule as given below −
- What are different types of recoverability of schedules(DBMS)?
- What are the different types of DBMS?
- What are different types of DBMS languages?
- Check if the given schedules are view serializable(DBMS)
- What are the different types of psychotherapy?
- What are the different types of ISDN?
- What are the Different Types of Marketing?
- What are different types of interrupts?
- What are Different Types of Testing?
- Explain the different types of users who play different roles in DBMS?
- What are the different types of LED available?
- What the different types of JSTL tags are ?
- What are the different types of Preference Shares?
- What are the different types of Operating Systems?
- What are the different types of Electric Heating?