in Databases
1,158 views
1 vote
1 vote

HOW TO SOLVE THOSE TYPE OF QUESTION?

in Databases
1.2k views

4 Comments

Ok bro i got it and that's why I drawn that polygraph see it :)
0
0
Hey, can someone explain to me why we aren't taking the initial read condition here? like T1 is doing the initial read of A from the database so, in every view serializable schedule, T1 should do that only I think ?
0
0
0
0

3 Answers

2 votes
2 votes
Best answer

A schedule Si that is view equivalent to another schedule Sj must the following conditions satisfied:

1. If transaction Ti reads the initial value of a data item in a schedule Si, then transaction Ti should read the initial value of that data item in schedule Sj.

Here since all the three transactions are reading the initial values of data item A, so in the view equivalent schedule also, all the three transactions will read the value of data item A.

2. if a transaction Ti writes the value of a data item(producer) that is read by a transaction Tj (consumer) in a schedule Si, then transaction Ti must write the value of the data item that is read by Tj in the schedule Sj.

In this question, since there are no producer-consumer dependencies between the transactions in the schedule S, so we need not worry about this condition not being satisfied in the view equivalent schedule.

3.if a transaction Ti writes the final value of a data item in schedule Si, then transaction Ti must also write the final value of that data item in schedule Sj.

Since here transaction T3 writes the final value of data item B in the schedule S, so in all schedules that are view equivalent to S, transaction T3 must write the final value of data item B.

Hence keep W3(B) fixed at the end. the remaining 5 operations can be arranged in 5! ways and the since the ordering of operations within a single transaction must not change, so divide 5! by 2! for each of the two transactions T1 and T2(Note: since there is only a single operation remaining in T3 after fixing W3(B) at the end, so we need not worry about the ordering of R3(B) since there is only one place left for it to appear, i.e. before W3(B))

Therefore, the number of schedules that are view equivalent to S are= 5! / (2! * 2!)=30

hence 30 view equivalent schedules are possible out of which one is already given in the question, i.e. schedule S.

selected by
0 votes
0 votes
Only one schedule is possible which is  (T1 T2 T3)

Is the answer is correct ??

inform me  kindly
by

2 Comments

@Magma read question carefully it is already serial

0
0

Deepanshu  please explain me how to solve these type of questions ?

I didn't understood properly

0
0
0 votes
0 votes

The polygraph for it would be this right ?

4 Comments

But see the previous comments..The initial Read on A does not matter as no one is modifying A so it's not compulsory for T1 to read A before anyone else. So whatever be the Read order of A, all of them will be reading the same unmodified value.
0
0
okay so what if t2 or t2 were modifying the value of A ?
0
0
Then the order of initial read would have mattered
1
1

Related questions