in Databases edited by
7,175 views
5 votes
5 votes

Assume basic timestamp ordering protocol and that time starts from $1$, each operation takes unit amount of time and start of transaction $T_i$ is denoted as $S_i$. The table of timestamp is given below:

Find $rts(a), wts(a), rts(b)$ and $wts(b)$ at the end

  1.   1, 5, 2, 5
  2.   1, 7, 3, 3
  3.   3, 7, 3, 7
  4.   1, 7, 3, 7
in Databases edited by
7.2k views

3 Comments

is it Option D

Youngest transaction who executed the given read/write will be its TS

1
1
Yes D is correct.. I am not getting..Can u please explain  ?
0
0
did you find a solution??
0
0

2 Answers

16 votes
16 votes
Best answer

Here,

T1 starts at TS =1

T2 starts at TS = 3

T3 starts at TS =7.

While giving the the TS for any read or write always look for youngest.

RTS(a) = a is first read by T1 hence RTS(a) =1. (Read(a) is never done anywhere again hence it is youngest)

WTS(a) = a is first written by T2 hence WTS(a) = 3. But again written by T3 which has higher TS (youngest) Hence final TS of W(a) = 7

RTS(b) = b is first read by T2 hence RTS(b) =3. (Read(b) is never done anywhere again hence it is youngest)

WTS(b) = b is first written by T2 hence WTS(b) = 3. But again written by T3 which has higher TS (youngest) Hence final TS of W(b) = 7

Hence answer is 1,7,3,7
selected by

2 Comments

Well explained..Thank you so much :) ... I understood it but want to learn more about it.. Can u please give me some video reference or any other reference related to it ?
0
0
what is the significance of serial no 1-9? As there is timestamp is 2 for r1(a) then why taking 1, similarly, so on.  i m not getting this. please explain!
0
0
4 votes
4 votes

Given information will be represented as in figure above. Now TS to a data item is assigned as the TS of latest transaction which accessed it. So RTS(a)= TS(S1)=1

WTS(a) = TS(S3) = 7, RTS(b) = TS(S2) = 3, WTS(b) = TS(S3)= 7 and thus option D is right answer.

"We can do it directly from given table also, then no need to make above table"

by

1 comment

Thank you so much..  Now I got it.
0
0

Related questions