Databases Reference
In-Depth Information
our policy becoming effective on February 2010. But let's sup-
pose that the correct date was actually the month before that.
How will we make this correction?
Because this correction will place data about an object into a
clock tick where it previously was absent, it is carried out with a
temporal insert transaction. Similarly, if we mistakenly place
data about an object into a clock tick where it doesn't belong,
we will need to use a temporal delete transaction to correct
our mistake. So we should note that with temporal data, it is
not just update transactions that can correct mistakes.
Immediately prior to this transaction, the currently asserted
life history of policy P861 is as shown in Figure 10.3 . It is still
August 2011, and we now submit the following transaction to
the AVF:
INSERT INTO Policy [P861, C882, PPO, $30] Jan 2010, Feb 2010
Immediately after this transaction is completed, that history
will be the history of the policy as asserted from when the previ-
ous transaction was applied up to August 2011. The new cur-
rently asserted history of the policy will be as shown in
Figure 10.4 . The new version—version 6—looks like this:
P[P861[Jan10-Feb10][Aug11-9999][Jan10][C882, PPO, $30]
[Aug11]]
Unlike our first insert transaction, this one does not create a
new episode; it extends an existing episode backwards in time.
But in doing so, it changes that episode's begin date. As we can
see from the schema common to all asserted version tables,
the episode begin date is repeated on every version in an epi-
sode. And by extending this episode backwards, this transaction
changes that episode's begin date. So as part of the atomic
isolated unit of work started by this transaction, the AVF must
also change the episode begin date on versions 1 and 2, the other
two versions in the new Episode A. This is done by withdrawing
those two versions and replacing them with versions identical to
them except that they have the correct episode begin date. Those
two replacement versions are versions 7 and 8, and the versions
Episode A
Episode C
Episode B
7 1
8 2
6
5
3
4
Jan
2010
Jan
2011
Jan
2012
Jan
2013
Jan
2014
Figure 10.4 Lengthening an Episode Backwards: After the Transaction.
Search WWH ::




Custom Search