Front Page Applet ATSQL UC TUC SEQ NSEQ System Guidelines Requirements Doc Support Information Contribution Warranty Related Work Contact Future Work | Sequentiality protects the investments in programmer training while providing advanced temporal functionality. Towards this goal two properties are crucial: snapshot reducibility and interval preservation. Snapshot reducibility implies that for all nontemporal queries, there must exist a temporal query, such that at each snapshot the result of the temporal query reduces to the result of the original query: For snapshot reducibility to be useful it is necessary to restrict the relationship between a nontemporal and the corresponding temporal query. We require q'= S1 q S2 with S1 and S2 being constant (statement independent) strings. The strings S1 and S2 are termed statement modifiers because they change the semantics of the entire enclosed statement. In ATSQL we have chosen to prepend statements with the statement modifier SEQ VT.
      SEQ VT SELECT * FROM p;

      CREATE TABLE q (B INTEGER SEQ VT PRIMARY KEY) AS VT;

      SET VT PERIOD '1974-1975' INSERT INTO q VALUES (6);
      SET VT PERIOD '1976-1978' INSERT INTO q VALUES (6);
      SET VT PERIOD '1977-1979' INSERT INTO q VALUES (6);

      SEQ VT SELECT * FROM q;
The first and last query simply return all tuples together with their valid time - this corresponds to returning the content of a table at each state. The second statement defines a table q and requires column B to be a sequenced primary key, i.e., B must be a primary key at each state (but not necessarily across states). This implies that there is a conflict between the second and third insert statement. Allowing both of them would mean to viaolate the primary key constraint in the years 1977 and 1978. The insert statement also illustrate the use of domain specifications. The statement modifier allows to explicitly set the valid time using the statement shown in the examples. A limitation of snapshot reducibility is that it does not distinguish relations if they are snapshot equivalent. To illustrate the issue, consider the following Figure.... Assuming that Val denotes the amount to be paid for electricity during the specified period, the two relations are quite different. In other words, the specified intervals can be relevant. Thus, the DBMS should not be allowed to merge and chop them. ATSQ is an interval-based language, which means that they are first class objects that can not be chopped and merged. This also holds true for SEQ statements, which is both faithful to intervals and snapshot reducibility. A second limitation of snapshot reducibility is that it is only applicable to nontemporal queries. Thus, it does not extend to queries such as the following.
      SEQ VT
         SELECT *
         FROM p, q
         WHERE p.X = q.X AND DURATION(VTIME(p),YEAR) > 5
The query is quite natural and easy to understand. It constrains the temporal join to p-tuples with a valid time longer than 5~years. Note that this condition cannot be evaluated on individual snapshots because the timestamp is lost when taking a snapshot of a temporal database. SEQ extends snapshot reducibility and allows the statement modifier to be applied to all statements.