- 27
- 0
- 约2.16万字
- 约 68页
- 2017-02-13 发布于湖北
- 举报
(T1,T2) R(A,t);t:=t+2;W(A,t); R(A,s);s:=s+3;W(A,s); R(B,t);t:=t*3;W(B,t); R(B,s);s:=s*2;W(B,s) 2 serial schedules and 402 serializable schedules (T1, T2): T1: R(A,t);t:=t+2;W(A,t); | R(B,t);t:=t*3;W(B,t); A0+2 3B0 T2: R(B,s);s:=s*2;W(B,s); | R(A,s);s:=s+3;W(A,s); 6B0 A0+5 (T2, T1): T2: R(B,s);s:=s*2;W(B,s); | R(A,s);s:=s+3;W(A,s); 2B0 A0+3 T1: R(A,t);t:=t+2;W(A,t); | R(B,t);t:=t*3;W(B,t); A0+5 6B0 The three writes create three versions of A. When T2 tries to read A, it is given the value that it itself wrote, since that is the version with the greatest timestamp that does not exceed the timestamp of T2. That makes sense, although in practice, we doubt that a well written transaction would read its own value through the database storage system. When T4 tries to read A the system finds that T4s timestamp is larger than that of any version of A written. Thus, T4 gets the version with the largest of the timestamps, the one written by T3. That makes sense, because in the hypothetical serial order based on the timestamps of the transactions, T3 would be the last to write A. As T1 is the first to validate, there is nothing to check; T1 validates successfully. T3 validates next. The only other validated transaction is T1, and T1 has not yet finished. Thus, both the read- and write-sets of T3 must be compared with the write-set of T1. However, T1 writes only A, and T3 neither reads nor writes A, so T3s validation succeeds. Last, T2 validates. Both T1 and T3 finish after T2 started, so we must compare the read-set of T2 with the write-sets of both T1 and T3. Since B is in both W3 and R2, we cannot validate T2. Note that since T3 (but not T1) finishes after T2 validates, we would also compare the write set of T2 with the write set of T3, ha
您可能关注的文档
最近下载
- 个人简历表格填写2021简历模板.docx VIP
- 针灸推拿学习题库(附答案).docx VIP
- 毕业设计(论文)-五边形凸台零件铣削加工.doc VIP
- 2026届山东省淄博市高三上学期期末考试(摸底质量检测)历史试题(含答案).docx VIP
- 常见词组固定搭配.pdf VIP
- 2023年山东泰安中考地理试题及答案.pdf VIP
- 胎动管理专家共识最新2025.pptx
- (小学综合实践课标复习题全.doc VIP
- 0—3岁婴幼儿心理发展与教育 第四章 0-3岁婴幼儿心理发展与教育 课件PPT.pptx VIP
- 0—3岁婴幼儿心理发展与教育 第三章 0-3岁婴幼儿心理发展与教育 课件PPT.pptx VIP
原创力文档

文档评论(0)