
- DBMS Tutorial
- DBMS - Home
- DBMS - Overview
- DBMS - Architecture
- DBMS - Data Models
- DBMS - Data Schemas
- DBMS - Data Independence
- Entity Relationship Model
- DBMS - ER Model Basic Concepts
- DBMS - ER Diagram Representation
- DBMS - Generalization, Aggregation
- Relational Model
- DBMS - Codd's Rules
- DBMS - Relational Data Model
- DBMS - Relational Algebra
- DBMS - ER to Relational Model
- DBMS- SQL Overview
- Relational Database Design
- DBMS - Database Normalization
- DBMS - Database Joins
- Storage and File Structure
- DBMS - Storage System
- DBMS - File Structure
- Indexing and Hashing
- DBMS - Indexing
- DBMS - Hashing
- Transaction And Concurrency
- DBMS - Transaction
- DBMS - Concurrency Control
- DBMS - Deadlock
- Backup and Recovery
- DBMS - Data Backup
- DBMS - Data Recovery
- DBMS Useful Resources
- DBMS - Quick Guide
- DBMS - Useful Resources
- DBMS - Discussion
Check if the given schedules are view serializable(DBMS)
A schedule has view-serializability if it is view equivalent to a serial schedule. A schedule is view serializable if the following three rules are satisfied −
Rule 1 − If Ti reads data initially, after this Tj writes the same data, in the given schedule. This sequence must be followed in the transaction combination (read write operation).
Rule 2 − If Ti writes data initially, after this Tj reads the same data, in the given schedule. This sequence must be followed in the transaction combination (write read operation).
Rule 3 − If Ti writes data, after this Tj writes the data finally. This sequence must be followed in the transaction combination (write-write operation).
Problem
Check the view serializability for the schedules R1(X), R2(Y), R2(Y), W2(X), W3(Y), R1(Y).
Solution
Create all possible combinations of the transactions, we have three transactions, so the combinations are as follows −
<T1, T2, T3>
<T1, T3, T2>
<T2, T1, T3>
<T2, T3, T1>
<T3, T1, T2>
<T3, T2, T1>
Rule 1 − T1 reads initially after this T2 writes the same data that means transaction sequence must be “T1 followed byT2” so, remove following combinations where “T1 is not followed by T2” that is T2 occur before T1 has to be removed.
<T2, T1, T3>
<T2, T3, T1>
<T3, T2, T1>
Rule 2 − T2 writes data, after this T1 reads the same data X, that means transaction sequence must be “T2 followed by T1”, now this rule violates RULE 1, because of this none of the rules can be applied so, it is not view serializable.
Rule 3 − we will not check RULE 3 because we have concluded that schedule is not view serializable in RULE 2.
Conclusion
The given schedule is not view serializable.
- Related Articles
- Check the view serializability for the given schedules(DBMS)
- Check whether two schedules are view equal or not(DBMS)
- What are the different types of schedules in DBMS?
- What are different types of recoverability of schedules(DBMS)?
- Explain schedules in 2PL with multiple granularities locking and schedules under tree(DBMS)
- Calculation of Serial and Non-Serial Schedules in DBMS
- Check if two given sets are disjoint?
- What is a materialized view in DBMS?
- Check if Table, View, Trigger, etc present in Oracle
- How to Check if the Given Arrays are Disjoint in Java?
- Java program to check if two given matrices are identical
- Python Program to check if two given matrices are identical
- PHP Serializable interface
- Program to check if two given matrices are identical in C++
- C++ Program to check if given numbers are coprime or not
