Precedence Graph - DBMS
Precedence Graph - DBMS
Home Coding problems DS & Algo. ▾ Languages ▾ Web. ▾ Programs ▾ Aptitude ▾ Interview ▾
Home »
DBMS
DBMS precedence graph: In this tutorial, we are going to learn about the precedence graph and the
algorithm for testing conflict serializability of a schedule in the database management system.
Submitted by Anushree Goswami, on September 06, 2019
Precedence graph
A precedence graph, also known as serialization graph or conflict graph, is used for testing Conflict
Serializability of a schedule in the condition that forms the setting of concurrency control in databases.
It is also known as a directed Graph G = (V, E), which consists of a pair of a set of nodes V = {V1, V2, V3, ...,
Vn} and a set of directed edges E = {E1, E2, E3, ..., Em}. Where the set of nodes V are testing to retrieve
identical data attribute through the transactions of a schedule and the set of edges E is regulated connectivity
between a set of two nodes.
https://www.includehelp.com/dbms/precedence-graph.aspx 1/7
7/6/2021 Precedence Graph | DBMS
Nodes: In the graph, for each transaction Tp the graph contains a single node. So, In a schedule of a
precedence graph, The total number of transactions will be similar to the total number of nodes.
Edges: An edge is regulated connectivity between a set of two distinct transactions Tq and Tr and it shows in the
format Tq –>Tr, where Tq is the beginning of the edge and Tr is the ending.
Example:
https://www.includehelp.com/dbms/precedence-graph.aspx 2/7
7/6/2021 Precedence Graph | DBMS
Solution:
In the above precedence graph, by following accordingly to the Algorithm, Transaction Tp implements reads A
before Transaction Tq implements writes A, therefore the first arrow directed from Transaction Tp towards
Transaction Tq and Transaction Tq reads B before Transaction Tp writes B, therefore the second arrow directed
from Transaction Tq towards Transaction Tp.
Since from the above precedence graph it's clearly visible that the graph is cyclic, therefore the schedule S is not
conflicted Serializable.
https://www.includehelp.com/dbms/precedence-graph.aspx 3/7
7/6/2021 Precedence Graph | DBMS
Solution:
https://www.includehelp.com/dbms/precedence-graph.aspx 4/7
7/6/2021 Precedence Graph | DBMS
In the above precedence graph, by following accordingly to the Algorithm, Transaction Tp implements reads A
before Transaction Tq implements writes A, therefore the first arrow directed.
from Transaction Tp towards Transaction Tq and Transaction Tq reads B before Transaction Tr writes B, therefore
the second arrow directed from Transaction Tq towards Transaction Tr and then the Transaction Tp reads C
before Transaction Tr writes C, therefore the third arrow directed from Transaction Tp towards Tr.
Since from the above precedence graph it's clearly visible that the graph is acyclic, therefore the schedule S is
conflict Serializable.
ADVERTISEMENT
ADVERTISEMENT
Compare related
Transaction in
DBMS | Data
Keys in Relational
genomes - identify
Database
Replication and its
DBMS, Foreign
Data Preprocessing
Representation of a
Explain the E-R
Head start to create
Structure - IncludeHelp
includehelp.com includehelp.com includehelp.com includehelp.com
Load comments
ADVERTISEMENT
https://www.includehelp.com/dbms/precedence-graph.aspx 6/7
7/6/2021 Precedence Graph | DBMS
Languages:
» C
» C++
» C++ STL
» Java
» Data Structure
» C#.Net
» Android
» Kotlin
» SQL
Web Technologies:
» PHP
» Python
» JavaScript
» CSS
» Ajax
» Node.js
» Web programming/HTML
Solved programs:
» C
» C++
» DS
» Java
» C#
CS Subjects:
» CS Basics
» O.S.
» Networks
» DBMS
» Embedded Systems
» Cloud Computing
» Machine learning
» CS Organizations
» Linux
» DOS
More:
» Articles
» Puzzles
» News/Updates
ABOUT SECTION
» About us
» Contact us
» Feedback
» Privacy policy
STUDENT'S SECTION
» Internship
» Certificates
» Content Writers of the Month
SUBSCRIBE
» Facebook
» LinkedIn
» Subscribe through email
https://www.includehelp.com/dbms/precedence-graph.aspx 7/7