Subject: Valid/Transaction times orthogonality

From: Shashi K. Gadia <[email-masked]>
Date: Mon, 5 Apr 93 16:00:01 CDT

The following discussion is about  
why the valid and transaction times 
are orthogonal.  It arose in correspondence 
from Fabio Grandi.  I though it may be 
of general interest, so I wrote it in 
a more context free style.  You may read it 
if you are interested. 

=================================================

Pure valid time v/s pure transaction time.  
------------------------------------------
The obstacle in our appreciation of the 
orthogonality between the valid and transaction 
times is that we typically tend to think of 
valid time in isolation, but we do not think of 
transaction time in isolation.  So let us try 
to think of the two times in isolation.  

Valid time database.
--------------------
For valid time, let us suppose there is a 
wizzard with E.S.P. The wizzard has the 
following capabilities:
A. The wizzard knows what is changing in the 
   real world, as and when it changes.
B. The wizzard can remember all the past 
   changes.  
C. The wizzard can assemble all his 
   knowledge in a coherent form which is 
   what we call a valid time database. 

The problem is that a wizzard as postulated 
above does is not feasible in practice.  So 
in valid time databases, what we do is 
that we first assemble a version of histroy.  
Then we allow portions of histories to be 
updated through update operations.  I assume 
the following:

   Assumption.  
   -----------  
   Updates overwrite our previous knowledge of 
   history and we have no way of remembering 
   the previous version of history.

   The resulting database is still 
identical to the one described above in terms 
of a wizzard.  Thus we have a more workable 
definition of a (pure) valid time database.

Transaction time database.
--------------------------
Suppse we have a classical snapshot database.  
We are updating this database to keep it 
up to date (as best as we can).  A transaction 
time database is now obtained with the 
capabilities B and C as stated above.  Note that 
such a database is "more than" a rollback 
database.

How do the valid time database and 
transaction time database compare now?

1. There is very little difference on 
    how users query them: 

   Valid-time query:
   -----------------
   [In reality,] When did John work in Toys?

   Transaction-time query:
   -----------------------
   [According to our information in the 
   database,] when did John work in Toys?

2. Both queries are answered by the same 
   algebraic expression:

   [[sigma (emp, Name=John, [[Dept=Toys]])]]

3. The update operations are different.  
   In the valid time case, we modify portions 
   of history.  In the transaction time case 
   we modify the current snapshot. 

Relaxing the assumptuion.  
-------------------------  
If we assume that not only we can modify 
portions of history, but can remember previous 
versions of history, we have a definition 
of a bitemporal database.  

Clearly, in bitemporal database there are two 
time dimensions, the valid time and transaction 
time.  In our bitemporal model, we use finite 
union of rectangles as timestamps.  The above 
query is now asked and formulated as follows:

   Bitemporal query.  
   -----------------   
   When did John work in toys. 
   [[sigma (emp, Name=John, [[Dept=Toys]])]]

   Again no difference!!!  What does the query 
   retrieve?  In all three cases of valid time, 
   transaction time and bitempopral databases, 
   the query is about the time stamp of the 
   event during which the database John is 
   shown to work in Toys.  

"As of" queries.  
----------------  
"As of" are special kinds of queries which were 
introduced by Ben-zwi in his bitemporal model 
during 1979-81.  In data processing applications 
this is a very important class of queries.  

Our bitemporal model.  
---------------------  
In our bitemporal model "as of" are very simple 
queries.  Our model achieves uninhibted navigation 
leading to true orthogonality between valid time, 
transaction time and bitemporal databases.