Note: a glossary of technical terms used in these articles can be found on the Web sites of the authors. The URLs are MindfulData.com and InbaseInc.com.
We are about to split an episode. The user knows nothing of this - all the user knows is what the database tells us right now and what changes he/she wants to make to the database.
With his/her delete transaction, as shown in Figure 1, the user is telling us, first of all, that she believes that the database currently asserts that P861 was in effect from 4/01/08 to 8/01/08. If that turns out not to be true, then the asserted versioning framework will reject his/her transaction. Next, the user is also telling us that he/she believes that P861 was not in effect during that time. The user now believes, in other words, that the correction made a month ago was a mistake. So he/she is submitting a transaction to return the database to its pre-3/01/09 assertion about P861, namely that it was in effect from January to April of last year, and from August of last year going forward, but it was not in effect from April to August.
Figure 1 shows us the Policy table after the delete transaction has been applied.
Figure 1: Splitting Episodes: After the Split
Applying the Deletion
As with any original delete transaction, the first thing that must be done is to withdraw the affected versions of the designated object from current assertion time. In this case, there is only one such assertion. It is the one made with row 3. Last month, row 3 began asserting that policy P861 was in effect from January to August of last year. We now believe (once again) that the assertion made by row 3 is incorrect, and so we withdraw it. We do this by overwriting the assertion end date of 9999 in row 3 with the current date, April 1, 2009.
The second temporal transaction creates the replacement assertion. That replacement is row 5; and starting in April of this year, it claims that policy P861 was in effect from January to April of last year not from January to August.
Viewing Asserted Version Table
Figures 2 and 3 show us two view tables a non-temporal and a uni-temporal one, respectively that are based on our asserted version Policy table. Like a corresponding conventional Policy table, what we see in these view tables depends on when we look at them.
By means of the dynamic views which these two SQL statements provide, we can always see what our policies look like at the current moment. We could do this with the view statement shown in Figure 2 by substituting "CURRENT-DATE" for "6/01/08." If we then direct all other conventional queries against that view, they can remain completely unchanged, and their result sets will be identical to the same queries executed against the corresponding conventional table at identical points in time.
When the SQL specifies a particular date, the dynamic view is a view of that data as of that point in time. As Figure 2 shows, from January 2008 forward, with the exception of March of this year, our Policy table asserted that there was no policy P861 in effect (or about to go into effect) on June 1, 2008. But during March of this year, our Policy table asserted that there was a policy P861 in effect on March 1, 2008.
Note that with all three views, what changed was not the policy. What changed was what we believed about the policy. In the view statement, the only variable is CURRENT-DATE, and it is being compared to the assertion time period of P861 rows. A row's assertion time period is the period of time during which we believe that the row makes a true statement.
Figure 2: Current Conventional Table Views of the Asserted Version Policy Table
Figure 3 shows us another view based on the same asserted version table, but one which materializes a versioned view table (i.e., a uni-temporal table).
Figure 3: Current Uni-temporal Views of the Asserted Version Policy Table
Note that with all three of these views, we are seeing policy P861 during the period of time that starts on January 1, 2008 and continues up to the present moment. This is a period in effective time, the time in which the object exists. And again, what changes from view 1 to view 2, and then from view 2 to view 3, is not the policy. It is what we believe the policy to be like. As time went by in the real world, the policy was what it was. It was in effect when it was in effect, and it was not in effect at all other times. But as that same real-world time went by, we changed our beliefs and, therefore, our assertions about what the policy was like over that stretch of real-world time.










Be the first to comment on this post using the section below.