Awesome q2a theme
0 votes

Are they view serializable or not ?

S1: r1(y), r2(x), r2(y), r3(y), w2(x), w1(y), w3(x), r1(x)

S2: r2(x), r3(z), w3(x), w2(x), w2(y), w3(z), r1(x), r1(y), w1(x), w1(y)

S3: r1(x), r2(x), r3(y), w1(x), r2(z), r2(y), w2(y), w1(z)

(Note: S1 is Conflict serialiazable hence View serializable also but I need to check directly how it VSS )

in Databases by (400 points) | 36 views
In S1,  if you don’t want to use the conflict serializability concept


you can check if the given schedule is view equivalent to its serial schedule or not.

if view equivalent to serial schedule then view serializable otherwise not view serializable.

1 Answer

+1 vote
Best answer

$\text{S1 is view serializable,}$ 

Starting from T2, initial read of x and y are preserved and are read from database. Then in T3 initial read of y is preserved and also read from DB and T1 is not writing x so final write is also preserved. Finally executing T1 initial read of Y is preserved and final write of y is preserved, also r1(x) is reading value updated by T3 and in serial schedule $T2 \rightarrow T3 \rightarrow T1$ r1(x) is reading value updated by T3.


$\text{S2 is not view serializable,}$

Starting from T2, initial read of x is from DB. hence T2 should come before T1 and T3 both as both are updating value of x. T1 should come at last because of final write of x as both T2 and T3 are writing on x. This tells us $T2 \rightarrow T3 \rightarrow T1$ might be view equivalent to S2 but then the problem is T1 will read value of x written by T3 and not T2 hence the contradiction. So there is no view equivalent serial schedule for S2.

As both T1 and T2 are reading value of x and T1 is later updating the value of x so T2 must appear before T1 So that it may not read value of x updated by T1. T3 is reading y from DB so T3 must execute before T2 as T2 is later updating y. 

This gives us serial schedule $T3 \rightarrow T2 \rightarrow T1$

Starting from T3 initial read of y is preserved. Then in T2 initial read of x,z and y is also preserved also T2 is finial writing y. then finally T1 is executed where it is reading value of x which is from DB and final write of x and z is also preserved.

Hence, $\text{S3 is view serializable schedule.}$

by (505 points)
selected by
Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true
Welcome to GATE CSE Doubts, where you can ask questions and receive answers from other members of the community.
Top Users May 2020
  1. Kushagra गुप्ता

    97 Points

  2. praveen modala

    15 Points

  3. ramcharantej_24

    15 Points

  4. abhishek tiwary

    12 Points

  5. srestha

    12 Points

  6. Dtiwari

    9 Points

  7. Shivateja MST

    8 Points

  8. ankitgupta.1729

    8 Points

  9. Rashimdixit

    7 Points

  10. Bhavya1902

    7 Points

7,376 questions
1,741 answers
90,352 users