Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Transaction Processing Consider the following oversimplified schema for a database to store a social network of friends and the Web pages they like. CREATE TABLE
Transaction Processing Consider the following oversimplified schema for a database to store a social network of friends and the Web pages they like. CREATE TABLE Friend (uid1 int, uid2 int); CREATE TABLE Likes (uid int, URL char (120)); CREATE VIEW LikeCount AS SELECT uid, count (*) AS cnt FROM Likes GROUP BY uid; Consider the following transactions: T1: SELECT count (*) FROM Likes WHERE uid-1234 T2 INSERT INTO Likes (uid, URL) VALUES (1234, "") T3 SELECT cnt FROM LikeCount WHERE uid-1234 (1234, "URL2>"; Suppose the scheduler accepts the three transactions at the same time, and assigns their start time as follows: start(T)=t; start(T)=t+1; start(Ta)=t+2, form some timestamp t. (13) (2 marks) Describe a concurrency control mechanism and a sequence of events that when applied to the scenario above would allow the three transactions to execute concurrently, COMMIT in the absence of system failures, and in a way that the values returned by T1 and T3 are the same. Your answer can involve any of the mechanisms discussed in class. Transaction Processing Consider the following oversimplified schema for a database to store a social network of friends and the Web pages they like. CREATE TABLE Friend (uid1 int, uid2 int); CREATE TABLE Likes (uid int, URL char (120)); CREATE VIEW LikeCount AS SELECT uid, count (*) AS cnt FROM Likes GROUP BY uid; Consider the following transactions: T1: SELECT count (*) FROM Likes WHERE uid-1234 T2 INSERT INTO Likes (uid, URL) VALUES (1234, "") T3 SELECT cnt FROM LikeCount WHERE uid-1234 (1234, "URL2>"; Suppose the scheduler accepts the three transactions at the same time, and assigns their start time as follows: start(T)=t; start(T)=t+1; start(Ta)=t+2, form some timestamp t. (13) (2 marks) Describe a concurrency control mechanism and a sequence of events that when applied to the scenario above would allow the three transactions to execute concurrently, COMMIT in the absence of system failures, and in a way that the values returned by T1 and T3 are the same. Your answer can involve any of the mechanisms discussed in class
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started