1 / 16

Serial and Serializable Schedules (Section 18.1)

Serial and Serializable Schedules (Section 18.1). Sean Gilpin ID: 109. Overview. Topics Covered: Schedules Serial Schedules Serializable Schedules Effect of Transaction Semantics Notation for Transactions and Schedules. Introduction.

Download Presentation

Serial and Serializable Schedules (Section 18.1)

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Serial and Serializable Schedules(Section 18.1) Sean Gilpin ID: 109

  2. Overview Topics Covered: • Schedules • Serial Schedules • Serializable Schedules • Effect of Transaction Semantics • Notation for Transactions and Schedules

  3. Introduction • In this section we are concerned with how transactions can be executed so as to preserve the consistency of the database. • The example of consistency used in this section is A=B. • As long as A=B is always true after we finish running the transactions then the consistency is preserved.

  4. Schedules • A schedule is a time-ordered sequence of actions taken by one or more transactions. • READ and WRITE actions, and their orders are important when considering concurrency.

  5. Serial Schedule • A schedule is serial if the transactions are executed as a whole one after the other. • For example if T2 is scheduled to run after T1 is completely finished then the schedule is serial. • If T2 is scheduled to run when T1 is only halfway finished then the schedule is not serial. • A serial schedule will preserve the consistency of the database state.

  6. Example of Serial Schedule

  7. Example Explored • Notice that before the transactions are run that A=B=25 • After the transactions run A=B=250, so consistency was preserved.

  8. Serializable Schedule • A schedule is serializable if its effect on the database state is the same as that of some serial schedule. • Must consider all initial states of the database.

  9. Example of Serializable Schedule

  10. Example Explored • This schedule has the same outcome as the serial schedule we explored earlier, so it is serializable. • It is important to see that the consistency is conserved for all initial database values not just for A=B=25 • You can deduce that if the initial state is A=B=c then this schedule will have the outcome A=B=2(c+100).

  11. Effect of Transaction Semantics • So far we have considered in detail the operations performed by the transactions. • It is not realistic for the scheduler to concern itself with the details of transactions. • To simplify the job of the scheduler, we will assume that no arithmetic coincidences will occur that would allow a schedule to be serializable.

  12. Explanation of Assumption

  13. Explanation of Assumption • Notice in previous example that the consistency is not preserved. • A=250 and B=150 at the end of the schedule.

  14. Explanation of Assumption

  15. Explanation of Assumption • This schedule is the same except we multiply by 1 instead of 2. • This schedule leads to a consistent state unlike previous example. • The point of the original assumption is that the database will not have time to explore such mathematical coincidences and it would not schedule the transaction in this way.

  16. Notation for Transactions and Schedules • Only the read and writes performed by the transaction matter. • rT(X) and wT(X) will be shorthand for transaction T reads and writes element X. • The transactions used in examples can be rewritten as:T1: r1(A); w1(A); r1(B); w1(B); T2: r2(A); w2(A); r2(B); w2(B); • The details of what T1 and T2 are doing (adding versus multiplying) do not matter since we will assume the worse.

More Related