0% found this document useful (0 votes)
114 views164 pages

CS6005 Advanced Database System UNIT III A

CS6005 Advanced Database System UNIT III A
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
114 views164 pages

CS6005 Advanced Database System UNIT III A

CS6005 Advanced Database System UNIT III A
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 164

Temporal Databases - 1-

RTS

Part 2
Temporal
Databases
Christian S. Jensen
and
Richard T. Snodgrass

Aalborg University
and
University of Arizona

-----Zaniolo--Ceri--Faloutsos--Snodgrass--Subrahmanian--Zicari--All Rights Reserved---


Advanced Database Systems Morgan Kaufmann
Copyright © 1995-7 Christian S. Jensen and Richard T. Snodgrass
Part 2 Temporal Databases - 2-
RTS

Part Overview

1. Introduction
◆ Applications
◆ Case study

2. Time Ontology
◆ Notions of time
◆ TSQL2 time ontology
◆ Time data types
◆ Clocks
◆ Times and facts

-----Zaniolo--Ceri--Faloutsos--Snodgrass--Subrahmanian--Zicari--All Rights Reserved---


Advanced Database Systems Morgan Kaufmann
Copyright © 1995-7 Christian S. Jensen and Richard T. Snodgrass
Part 2 Temporal Databases - 3-
RTS

Part Overview, cont.

• 3. Temporal Data Models


◆ Design space
◆ Sample data models
◆ Objectives of a data model

• 4. TSQL2 Data Model


◆ Bitemporal Conceptual Data Model

• 5. TSQL2 Temporal Query Language


◆ Language constructs

-----Zaniolo--Ceri--Faloutsos--Snodgrass--Subrahmanian--Zicari--All Rights Reserved---


Advanced Database Systems Morgan Kaufmann
Copyright © 1995-7 Christian S. Jensen and Richard T. Snodgrass
Part 2 Temporal Databases - 4-
RTS

Part Overview, cont.

6. Temporal DBMS Implementation


◆ Extending the conventional architecture
◆ A temporal algebra
◆ Operator implementations
◆ Temporal indexing

7. Part Summary
◆ Part summary
◆ Stages of research in temporal databases
◆ The future

-----Zaniolo--Ceri--Faloutsos--Snodgrass--Subrahmanian--Zicari--All Rights Reserved---


Advanced Database Systems Morgan Kaufmann
Copyright © 1995-7 Christian S. Jensen and Richard T. Snodgrass
Sec: 5.1 Temporal Databases -1 -
RTS

1. An Introduction to Temporal
Databases

• Applications abound

• A case study using SQL


◆ Queries on time-varying data are hard to
express in SQL.
◆ Temporal databases provide built-in
support for such queries.

• Summary

-----Zaniolo--Ceri--Faloutsos--Snodgrass--Subrahmanian--Zicari--All Rights Reserved----


Advanced Database Systems Morgan Kaufmann
Copyright © 1995-7 Christian S. Jensen and Richard T. Snodgrass
Sec: 5.1 Temporal Databases -2 -
RTS

Temporal Database Systems

• Provide built-in support for recording


and querying time-varying
information.

• Example: Media Planning


◆ Which advertisements are to appear?
◆ When should the advertisements appear?
◆ What is the advertising budget over time
for different media?

-----Zaniolo--Ceri--Faloutsos--Snodgrass--Subrahmanian--Zicari--All Rights Reserved----


Advanced Database Systems Morgan Kaufmann
Copyright © 1995-7 Christian S. Jensen and Richard T. Snodgrass
Sec: 5.1 Temporal Databases -3 -
RTS

Applications

• Academic
◆ Transcripts record courses taken in
previous and the current semester or term
and grades for previous courses

• Accounting
◆ What bills were sent out and when, what
payments were received and when?
◆ Delinquent accounts, cash flow over time
◆ Money-management software such as
Quicken® can show e.g., account balance
over time.

• Budgets
◆ Previous and projected budgets, multi-
quarter or multi-year budgets

-----Zaniolo--Ceri--Faloutsos--Snodgrass--Subrahmanian--Zicari--All Rights Reserved----


Advanced Database Systems Morgan Kaufmann
Copyright © 1995-7 Christian S. Jensen and Richard T. Snodgrass
Sec: 5.1 Temporal Databases -4 -
RTS

Applications, cont.

• Data Warehousing
◆ Historical trend analysis for decision
support
• Financial
◆ Stock market data
◆ Audit analysis: why were financial
decisions made, and with what
information available?
◆ Program trading
• Geographic Information Systems
(GIS)
◆ Land use over time: boundary of parcels
change over time, as parcels get
partitioned and merged.
◆ Title searches

-----Zaniolo--Ceri--Faloutsos--Snodgrass--Subrahmanian--Zicari--All Rights Reserved----


Advanced Database Systems Morgan Kaufmann
Copyright © 1995-7 Christian S. Jensen and Richard T. Snodgrass
Sec: 5.1 Temporal Databases -5 -
RTS

Applications, cont.

• Insurance
◆ Which policy was in effect at each point
in time, and what time periods did that
policy cover?
• Inventory
◆ Inventory over time, for time-series
analysis, accounting
• Legal records
◆ Validity periods for laws
• Medical records
◆ Patient records, drug regimes, lab tests
◆ Tracking course of disease
◆ Longitudinal studies

-----Zaniolo--Ceri--Faloutsos--Snodgrass--Subrahmanian--Zicari--All Rights Reserved----


Advanced Database Systems Morgan Kaufmann
Copyright © 1995-7 Christian S. Jensen and Richard T. Snodgrass
Sec: 5.1 Temporal Databases -6 -
RTS

Applications, cont.

• Payroll
◆ Past employees, employee salary history,
salaries for future months, records of
with-holding requested by employees

• Planning
◆ Use current and previous schedules for
designing new schedules
◆ Planning for future contingencies
◆ Network management

• Process monitoring
◆ Chemical, nuclear power plant
monitoring
◆ Active databases

-----Zaniolo--Ceri--Faloutsos--Snodgrass--Subrahmanian--Zicari--All Rights Reserved----


Advanced Database Systems Morgan Kaufmann
Copyright © 1995-7 Christian S. Jensen and Richard T. Snodgrass
Sec: 5.1 Temporal Databases -7 -
RTS

Applications, cont.

• Project scheduling
◆ Milestones, task assignments

• Reservation systems
◆ E.g., airlines, hotels, trains
◆ Configuring new routes, ensuring high
utilization

• Scientific databases
◆ Recording experiments
◆ Timestamping satellite images
◆ Dating archeological finds

-----Zaniolo--Ceri--Faloutsos--Snodgrass--Subrahmanian--Zicari--All Rights Reserved----


Advanced Database Systems Morgan Kaufmann
Copyright © 1995-7 Christian S. Jensen and Richard T. Snodgrass
Sec: 5.1 Temporal Databases -8 -
RTS

Applications: Conclusion

• It is difficult to identify applications


that do not involve the management
of temporal data.

• These applications would benefit


from built-in temporal support in the
DBMS.
◆ More efficient application development
◆ Potential increase in performance

-----Zaniolo--Ceri--Faloutsos--Snodgrass--Subrahmanian--Zicari--All Rights Reserved----


Advanced Database Systems Morgan Kaufmann
Copyright © 1995-7 Christian S. Jensen and Richard T. Snodgrass
Sec: 5.1 Temporal Databases -9 -
RTS

A Case Study

• University of Arizona’s Office of


Appointed Personnel has some
information in a database.
◆ Employee(Name, Salary, Title)

• Finding an employee’s salary is easy.


SELECT Salary
FROM Employee
WHERE Name = ’Bob’

• The OAP wishes to add the date of birth


◆ Employee(Name, Salary, Title, DateofBirth DATE)

-----Zaniolo--Ceri--Faloutsos--Snodgrass--Subrahmanian--Zicari--All Rights Reserved----


Advanced Database Systems Morgan Kaufmann
Copyright © 1995-7 Christian S. Jensen and Richard T. Snodgrass
Sec: 5.1 Temporal Databases - 10 -
RTS

Converting to a Temporal
Database

• Finding the employee’s date of birth


is equally easy.

SELECT DateofBirth
FROM Employee
WHERE Name = ’Bob’

• Now the OAP wishes to computerize


the employment history.
◆ Employee (Name, Salary, Title, DateofBirth,
Start DATE, Stop DATE)

-----Zaniolo--Ceri--Faloutsos--Snodgrass--Subrahmanian--Zicari--All Rights Reserved----


Advanced Database Systems Morgan Kaufmann
Copyright © 1995-7 Christian S. Jensen and Richard T. Snodgrass
Sec: 5.1 Temporal Databases - 11 -
RTS

Converting to a Temporal
Database

• To the data model, these new columns


are identical to DateofBirth.

Name Salary Title DateofBirth Start Stop


Bob 60000 Assistant Provost 1945-04-19 1993-01-01 1993-06-01
Bob 70000 Assistant Provost 1945-04-19 1993-06-01 1993-10-01
Bob 70000 Provost 1945-04-19 1993-10-01 1994-02-01
Bob 70000 Professor 1945-04-19 1994-02-01 1995-01-01

-----Zaniolo--Ceri--Faloutsos--Snodgrass--Subrahmanian--Zicari--All Rights Reserved----


Advanced Database Systems Morgan Kaufmann
Copyright © 1995-7 Christian S. Jensen and Richard T. Snodgrass
Sec: 5.1 Temporal Databases - 12 -
RTS

Extracting the Salary

• To find the employee’s current salary,


things are more difficult.

SELECT Salary
FROM Employee
WHERE Name = ’Bob’
AND Start <= CURRENT_TIMESTAMP
AND CURRENT_TIMESTAMP <= Stop

-----Zaniolo--Ceri--Faloutsos--Snodgrass--Subrahmanian--Zicari--All Rights Reserved----


Advanced Database Systems Morgan Kaufmann
Copyright © 1995-7 Christian S. Jensen and Richard T. Snodgrass
Sec: 5.1 Temporal Databases - 13 -
RTS

Distributing the Salary History

• OAP wants to distribute to all


employees their salary history.
◆ Output: For each person, maximal
intervals at each salary

Name Salary Start Stop


Bob 60000 1993-01-01 1993-06-01
Bob 70000 1993-06-01 1995-01-01

◆ Employee could have arbitrarily many


title changes between salary changes.

-----Zaniolo--Ceri--Faloutsos--Snodgrass--Subrahmanian--Zicari--All Rights Reserved----


Advanced Database Systems Morgan Kaufmann
Copyright © 1995-7 Christian S. Jensen and Richard T. Snodgrass
Sec: 5.1 Temporal Databases - 14 -
RTS

Extracting the Salary, cont.

• Alternative 1
◆ Give the user a printout of Salary and
Title information, and have user
determine when his/her salary changed.

• Alternative 2
◆ Use SQL as much as possible.
◆ Find those intervals that overlap or are
adjacent and thus should be merged.

-----Zaniolo--Ceri--Faloutsos--Snodgrass--Subrahmanian--Zicari--All Rights Reserved----


Advanced Database Systems Morgan Kaufmann
Copyright © 1995-7 Christian S. Jensen and Richard T. Snodgrass
Sec: 5.1 Temporal Databases - 15 -
RTS

SQL Code

CREATE TABLE Temp(Salary, Start, Stop)


AS SELECT Salary, Start, Stop
FROM Employee
WHERE Name = ’Bob’;

repeat
UPDATE Temp AS T1
SET (T1.Stop) = (SELECT MAX(T2.Stop)
FROM Temp AS T2
WHERE T1.Salary = T2.Salary
AND T1.Start < T2.Start
AND T1.Stop >= T2.Start
AND T1.Stop < T2.Stop)
WHERE EXISTS (SELECT *
FROM Temp AS T2
WHERE T1.Salary = T2.Salary
AND T1.Start < T2.Start
AND T1.Stop >= T2.Start
AND T1.Stop < T2.Stop)
until no tuples updated;

-----Zaniolo--Ceri--Faloutsos--Snodgrass--Subrahmanian--Zicari--All Rights Reserved----


Advanced Database Systems Morgan Kaufmann
Copyright © 1995-7 Christian S. Jensen and Richard T. Snodgrass
Sec: 5.1 Temporal Databases - 16 -
RTS

Example

• Initial table

• After one pass

• After two passes

-----Zaniolo--Ceri--Faloutsos--Snodgrass--Subrahmanian--Zicari--All Rights Reserved----


Advanced Database Systems Morgan Kaufmann
Copyright © 1995-7 Christian S. Jensen and Richard T. Snodgrass
Sec: 5.1 Temporal Databases - 17 -
RTS

SQL Code, cont.

• The loop is executed lgN times in the


worst case, where N is the number of
tuples in a chain of overlapping or
adjacent, value-equivalent tuples.
• Then delete extraneous, non-maximal
intervals.

DELETE FROM Temp T1


WHERE EXISTS (SELECT *
FROM Temp AS T2
WHERE T1.Salary = T2.Salary
AND ((T1.Start > T2.Start
AND T1.Stop <= T2.Stop)
OR (T1.Start >= T2.Start
AND T1.Stop < T2.Stop))

-----Zaniolo--Ceri--Faloutsos--Snodgrass--Subrahmanian--Zicari--All Rights Reserved----


Advanced Database Systems Morgan Kaufmann
Copyright © 1995-7 Christian S. Jensen and Richard T. Snodgrass
Sec: 5.1 Temporal Databases - 18 -
RTS

Entirely in SQL

• Alternative 3: Use SQL entirely.


CREATE TABLE Temp(Salary, Start, Stop)
AS SELECT Salary, Start, Stop
FROM Employee
WHERE Name = ’Bob’;

SELECT DISTINCT F.Salary, F.Start, L.Stop


FROM Temp AS F, Temp AS L
WHERE F.Start < L.Stop
AND F.Salary = L.Salary
AND NOT EXISTS (SELECT *
FROM Temp AS M
WHERE M.Salary = F.Salary
AND F.Start < M.Start
AND M.Start < L.Stop
AND NOT EXISTS (SELECT *
FROM Temp AS T1
WHERE T1.Salary = F.Salary
AND T1.Start < M.Start
AND M.Start <= T1.Stop))
AND NOT EXISTS (SELECT *
FROM Temp AS T2
WHERE T2.Salary = F.Salary
AND ((T2.Start < F.Start
AND F.Start <= T2.Stop)
OR (T2.Start < L.Stop
AND L.Stop < T2.Stop)))

-----Zaniolo--Ceri--Faloutsos--Snodgrass--Subrahmanian--Zicari--All Rights Reserved----


Advanced Database Systems Morgan Kaufmann
Copyright © 1995-7 Christian S. Jensen and Richard T. Snodgrass
Sec: 5.1 Temporal Databases - 19 -
RTS

Using More Procedural Code

• Alternative 4: Use SQL only to open a


cursor on the table
Maintain a linked list of intervals, each with a salary;
Initialize this linked list to empty;

DECLARE emp_cursor CURSOR FOR


SELECT Salary, Start, Stop
FROM Employee;
OPEN emp_cursor;

loop:
FETCH emp_cursor INTO :salary,:start,:stop;
if no data returned then go to finished;
find position in linked list to insert this information;
go to loop;

finished:
CLOSE emp_cursor;

iterate through linked list, printing out dates and salaries

-----Zaniolo--Ceri--Faloutsos--Snodgrass--Subrahmanian--Zicari--All Rights Reserved----


Advanced Database Systems Morgan Kaufmann
Copyright © 1995-7 Christian S. Jensen and Richard T. Snodgrass
Sec: 5.1 Temporal Databases - 20 -
RTS

Alternatives, cont.

• Original table

• Linked list is not necessary in this


case if the cursor is ORDER BY
Salary,Start
• Alternative 5: Use transitive closure
or triggers in SQL3.

-----Zaniolo--Ceri--Faloutsos--Snodgrass--Subrahmanian--Zicari--All Rights Reserved----


Advanced Database Systems Morgan Kaufmann
Copyright © 1995-7 Christian S. Jensen and Richard T. Snodgrass
Sec: 5.1 Temporal Databases - 21 -
RTS

Extracting the Salary

• TSQL2:

SELECT Salary
FROM Employee
WHERE Name = ’Bob’

-----Zaniolo--Ceri--Faloutsos--Snodgrass--Subrahmanian--Zicari--All Rights Reserved----


Advanced Database Systems Morgan Kaufmann
Copyright © 1995-7 Christian S. Jensen and Richard T. Snodgrass
Sec: 5.1 Temporal Databases - 22 -
RTS

More Drastic Alternatives

• Reorganize the schema


◆ Separate Salary, Title, and
DateofBirth information
◆ Employee1 (Name, Salary, Start
DATE, Stop DATE)
◆ Employee2 (Name, Title, Start
DATE, Stop DATE)
• Getting the salary information is now
easy
SELECT Salary, Start, Stop
FROM Employee1
WHERE Name = ’Bob’

• But what if the OAP wants a table of


salary, title intervals?

-----Zaniolo--Ceri--Faloutsos--Snodgrass--Subrahmanian--Zicari--All Rights Reserved----


Advanced Database Systems Morgan Kaufmann
Copyright © 1995-7 Christian S. Jensen and Richard T. Snodgrass
Sec: 5.1 Temporal Databases - 23 -
RTS

An Example of Temporal Join

• Employee1:
Name Salary Start Stop
Bob 60000 1993-01-01 1993-06-01
Bob 70000 1993-06-01 1995-01-01

• Employee2:
Name Title Start Stop
Bob Assistant Provost 1993-01-01 1993-10-01
Bob Provost 1993-10-01 1994-02-01
Bob Full Professor 1994-02-01 1995-01-01

• Result of temporal join:


Name Salary Title Start Stop
Bob 60000 Assistant Provost 1993-01-01 1993-06-01
Bob 70000 Assistant Provost 1993-06-01 1993-10-01
Bob 70000 Provost 1993-10-01 1994-02-01
Bob 70000 Full Professor 1994-02-01 1995-01-01

-----Zaniolo--Ceri--Faloutsos--Snodgrass--Subrahmanian--Zicari--All Rights Reserved----


Advanced Database Systems Morgan Kaufmann
Copyright © 1995-7 Christian S. Jensen and Richard T. Snodgrass
Sec: 5.1 Temporal Databases - 24 -
RTS

Evaluating the Temporal Join

• Alternative 1: Print out two tables, and


let the user figure out the combinations
• Alternative 2: Use SQL entirely
◆ Case 1:

SELECT Employee1.Name, Salary, Title,


Employee1.Start, Employee1.Stop
FROM Employee1, Employee2
WHERE Employee1.Name = Employee2.Name
AND Employee2.Start <= Employee1.Start
AND Employee1.Stop <= Employee2.Stop

-----Zaniolo--Ceri--Faloutsos--Snodgrass--Subrahmanian--Zicari--All Rights Reserved----


Advanced Database Systems Morgan Kaufmann
Copyright © 1995-7 Christian S. Jensen and Richard T. Snodgrass
Sec: 5.1 Temporal Databases - 25 -
RTS

Temporal Join in SQL

SELECT Employee1.Name, Salary, Title,


Employee1.Start, Employee1.Stop
FROM Employee1, Employee2
WHERE Employee1.Name = Employee2.Name
AND Employee2.Start <= Employee1.Start
AND Employee1.Stop <= Employee2.Stop
UNION ALL
SELECT Employee1.Name, Salary, Title,
Employee1.Start, Employee2.Stop
FROM Employee1, Employee2
WHERE Employee1.Name = Employee2.Name
AND Employee1.Start > Employee2.Start
AND Employee2.Stop < Employee1.Stop
AND Employee1.Start < Employee2.Stop
UNION ALL
SELECT Employee1.Name, Salary, Title
Employee2.Start, Employee1.Stop
FROM Employee1, Employee2
WHERE Employee1.Name = Employee2.Name
AND Employee2.Start > Employee1.Start
AND Employee1.Stop <= Employee2.Stop
AND Employee2.Start < Employee1.Stop
UNION ALL
SELECT Employee1.Name, Salary, Title
Employee2.Start, Employee2.Stop
FROM Employee1, Employee2
WHERE Employee1.Name = Employee2 Name
AND Employee2.Start => Employee1.Start
AND Employee2.Stop <= Employee1.Stop
AND NOT (Employee1.Start = Employee2.Start
AND Employee1.Stop = Employee2.Stop)

-----Zaniolo--Ceri--Faloutsos--Snodgrass--Subrahmanian--Zicari--All Rights Reserved----


Advanced Database Systems Morgan Kaufmann
Copyright © 1995-7 Christian S. Jensen and Richard T. Snodgrass
Sec: 5.1 Temporal Databases - 26 -
RTS

Temporal Join, cont.

• Alternative 3: Use embedded SQL

• TSQL2:

SELECT Employee1.Name, Salary, Title


FROM Employee1, Employee2
WHERE Employee1.Name = Employee2.Name

-----Zaniolo--Ceri--Faloutsos--Snodgrass--Subrahmanian--Zicari--All Rights Reserved----


Advanced Database Systems Morgan Kaufmann
Copyright © 1995-7 Christian S. Jensen and Richard T. Snodgrass
Sec: 5.1 Temporal Databases - 27 -
RTS

Summary

• Applications manage temporal data.

• If a temporal DBMS is used


◆ Schemas are simpler
◆ SQL queries are much simpler
◆ Much less procedural code is needed

• Benefits
◆ Application code is less complex
✱ Easier to understand
✱ Easier to ensure correctness
✱ Easier to maintain

◆ Performance may be enhanced by


relegating functionality to the DBMS.
-----Zaniolo--Ceri--Faloutsos--Snodgrass--Subrahmanian--Zicari--All Rights Reserved----
Advanced Database Systems Morgan Kaufmann
Copyright © 1995-7 Christian S. Jensen and Richard T. Snodgrass
Sec: 5.2-5.3 Temporal Databases - 1 -
RTS

2. Time Ontology

• Notions of Time
◆ Structure
◆ Boundedness
◆ Density

• TSQL2 Time Ontology

• Time Data Types

• Clocks

• Time and Facts

-----Zaniolo--Ceri--Faloutsos--Snodgrass--Subrahmanian--Zicari--All Rights Reserved----


Advanced Database Systems Morgan Kaufmann
Copyright © 1995-7 Christian S. Jensen and Richard T. Snodgrass
Sec: 5.2-5.3 Temporal Databases - 2 -
RTS

Time Structure

• Linear

now

-----Zaniolo--Ceri--Faloutsos--Snodgrass--Subrahmanian--Zicari--All Rights Reserved----


Advanced Database Systems Morgan Kaufmann
Copyright © 1995-7 Christian S. Jensen and Richard T. Snodgrass
Sec: 5.2-5.3 Temporal Databases - 3 -
RTS

Time Structure, cont.

• Possible Futures (Hypothetical)

now

• Branching Time

• Directed Acyclic Graph

-----Zaniolo--Ceri--Faloutsos--Snodgrass--Subrahmanian--Zicari--All Rights Reserved----


Advanced Database Systems Morgan Kaufmann
Copyright © 1995-7 Christian S. Jensen and Richard T. Snodgrass
Sec: 5.2-5.3 Temporal Databases - 4 -
RTS

Time Structure, cont.

• Periodic/Cyclic Time

Sunday

Monday
Saturday

Friday Tuesday

Thursday
Wednesday

-----Zaniolo--Ceri--Faloutsos--Snodgrass--Subrahmanian--Zicari--All Rights Reserved----


Advanced Database Systems Morgan Kaufmann
Copyright © 1995-7 Christian S. Jensen and Richard T. Snodgrass
Sec: 5.2-5.3 Temporal Databases - 5 -
RTS

Boundedness of Time

• From now on, we will assume a linear


time structure.

• Boundedness
◆ Unbounded
◆ Time origin exists (bounded from the left)
◆ Bounded time (bounds on both ends)

• Nature of bound
◆ Unspecified
◆ Specified

-----Zaniolo--Ceri--Faloutsos--Snodgrass--Subrahmanian--Zicari--All Rights Reserved----


Advanced Database Systems Morgan Kaufmann
Copyright © 1995-7 Christian S. Jensen and Richard T. Snodgrass
Sec: 5.2-5.3 Temporal Databases - 6 -
RTS

Time Density

• Discrete
◆ Time line is isomorphic to the integers.
◆ Timeline composed of a sequence of non-
decomposable time periods of some
fixed, minimal duration, termed
chronons.
◆ Between each pair of chronons is a finite
number of other chronons.

• Dense
◆ Time line is isomorphic to the rational
numbers.
◆ Between any two chronons is an infinite
number of other instants.

-----Zaniolo--Ceri--Faloutsos--Snodgrass--Subrahmanian--Zicari--All Rights Reserved----


Advanced Database Systems Morgan Kaufmann
Copyright © 1995-7 Christian S. Jensen and Richard T. Snodgrass
Sec: 5.2-5.3 Temporal Databases - 7 -
RTS

Time Density, cont.

• Continuous
◆ Time line is isomorphic to the real
numbers.
◆ Between each pair of instants is a infinite
number of other instants.

• Distance may optionally be defined.

-----Zaniolo--Ceri--Faloutsos--Snodgrass--Subrahmanian--Zicari--All Rights Reserved----


Advanced Database Systems Morgan Kaufmann
Copyright © 1995-7 Christian S. Jensen and Richard T. Snodgrass
Sec: 5.2-5.3 Temporal Databases - 8 -
RTS

Ontological Temporal Types

• A time instant is a time point on the


real time line.
◆ An event is an instantaneous fact, i.e,
something occurring at an instant. The
event occurrence time of an event is the
instant at which the event occurs in the
real world.

• An instant set is a set of instants.

• A time period is the time between two


instants.
◆ Also called interval, but this conflicts
with the SQL data type INTERVAL.

-----Zaniolo--Ceri--Faloutsos--Snodgrass--Subrahmanian--Zicari--All Rights Reserved----


Advanced Database Systems Morgan Kaufmann
Copyright © 1995-7 Christian S. Jensen and Richard T. Snodgrass
Sec: 5.2-5.3 Temporal Databases - 9 -
RTS

Ontological Types, cont.

• A time interval is a directed duration


of time. A duration is an amount of
time with a known length, but no
specific starting or ending instants.
Also called a span.
◆ A positive interval denotes forward
motion of time; a negative interval
denotes backwards motion of time.

• A temporal element is a finite union


of periods.

-----Zaniolo--Ceri--Faloutsos--Snodgrass--Subrahmanian--Zicari--All Rights Reserved----


Advanced Database Systems Morgan Kaufmann
Copyright © 1995-7 Christian S. Jensen and Richard T. Snodgrass
Sec: 5.2-5.3 Temporal Databases - 10 -
RTS

Clocks

• A clock is a physical process coupled


with a method of measuring that
process.

• The units of measurement are the


chronons of the clock.

• Clocks provide the semantics of a


timestamp representation.

-----Zaniolo--Ceri--Faloutsos--Snodgrass--Subrahmanian--Zicari--All Rights Reserved----


Advanced Database Systems Morgan Kaufmann
Copyright © 1995-7 Christian S. Jensen and Richard T. Snodgrass
Sec: 5.2-5.3 Temporal Databases - 11 -
RTS

Clocks, cont.

• Year Clocks

• Day clocks

• Second clocks

• Other clocks

-----Zaniolo--Ceri--Faloutsos--Snodgrass--Subrahmanian--Zicari--All Rights Reserved----


Advanced Database Systems Morgan Kaufmann
Copyright © 1995-7 Christian S. Jensen and Richard T. Snodgrass
Sec: 5.2-5.3 Temporal Databases - 12 -
RTS

Representing Time in a Database

• Discrete representation
◆ A bounded discrete representation of
time is the simplest option.

• Dense representation
◆ A bounded dense representation is also
not difficult to manage, as all rationals
may be expressed as the ratio between
two integers. A floating point
representation may also be employed.

• Continuous representation
◆ A bounded continuous representation is
the most difficult option.

-----Zaniolo--Ceri--Faloutsos--Snodgrass--Subrahmanian--Zicari--All Rights Reserved----


Advanced Database Systems Morgan Kaufmann
Copyright © 1995-7 Christian S. Jensen and Richard T. Snodgrass
Sec: 5.4.1 Temporal Databases - 13 -
RTS

Times and Facts

• Valid time of a fact: when the fact is


true in the modeled reality

• Transaction time of a fact: when the


fact is current in the database and may
be retrieved

• Four kinds of tables


◆ snapshot
◆ valid-time
◆ transaction-time
◆ bitemporal

-----Zaniolo--Ceri--Faloutsos--Snodgrass--Subrahmanian--Zicari--All Rights Reserved---


Advanced Database Systems Morgan Kaufmann
Copyright © 1995-7 Christian S. Jensen and Richard T. Snodgrass
Sec: 5.4.1 Temporal Databases - 14 -
RTS

A Snapshot Table

• Can be modified
• Used for static queries
• What is Tom’s rank?

SELECT Rank
FROM Faculty
WHERE Name = ’Tom’

-----Zaniolo--Ceri--Faloutsos--Snodgrass--Subrahmanian--Zicari--All Rights Reserved---


Advanced Database Systems Morgan Kaufmann
Copyright © 1995-7 Christian S. Jensen and Richard T. Snodgrass
Sec: 5.4.1 Temporal Databases - 15 -
RTS

Analogy: A Stack of Vitæ

(Jan. 1984) (Dec. 1984)


Assistant
Instructor Tom Prof. Tom

(March 1989) (July 1989)


Assistant Associate
Prof. Tom Prof. Tom

-----Zaniolo--Ceri--Faloutsos--Snodgrass--Subrahmanian--Zicari--All Rights Reserved---


Advanced Database Systems Morgan Kaufmann
Copyright © 1995-7 Christian S. Jensen and Richard T. Snodgrass
Sec: 5.4.1 Temporal Databases - 16 -
RTS

Tom’s Employment History

• On January 1, 1984, Tom joined the


faculty as an Instructor.

• On December 1, 1984, Tom


completed his doctorate, and so was
promoted to Assistant Professor
retroactively on July 1, 1984.

• On March 1, 1989, Tom was


promoted to Associate Professor,
proactively on July 1, 1989.

-----Zaniolo--Ceri--Faloutsos--Snodgrass--Subrahmanian--Zicari--All Rights Reserved---


Advanced Database Systems Morgan Kaufmann
Copyright © 1995-7 Christian S. Jensen and Richard T. Snodgrass
Sec: 5.4.1 Temporal Databases - 17 -
RTS

A Transaction-time Table

Transaction
Time

• Append-only: correction to
previous snapshot states is not
permitted
• Supports transaction time
• Supports rollback queries
• What did we believe Tom’s rank
was on October 1, 1984?
SELECT Rank
FROM Faculty
WHERE Name = ’Tom’ AND
TRANSACTION(Faculty) OVERLAPS DATE ’1984-10-01’

-----Zaniolo--Ceri--Faloutsos--Snodgrass--Subrahmanian--Zicari--All Rights Reserved---


Advanced Database Systems Morgan Kaufmann
Copyright © 1995-7 Christian S. Jensen and Richard T. Snodgrass
Sec: 5.4.1 Temporal Databases - 18 -
RTS

Analogy: Pay Stubs

Instructor Tom 1-1-84


Instructor Tom 2-1-84
...
Instructor Tom 11-1-84
Assistant Prof. Tom 12-1-84
...
Assistant Prof. Tom 6-1-89
Associate Prof. Tom 7-1-89

-----Zaniolo--Ceri--Faloutsos--Snodgrass--Subrahmanian--Zicari--All Rights Reserved---


Advanced Database Systems Morgan Kaufmann
Copyright © 1995-7 Christian S. Jensen and Richard T. Snodgrass
Sec: 5.4.1 Temporal Databases - 19 -
RTS

A Valid-Time Table

Valid
Time

• May be modified
• Supports valid time
• Supports historical queries
• What was Tom’s rank on October 1,
1984 (as best known)?

SELECT Rank
FROM Faculty
WHERE Name = ’Tom’
AND VALID(Faculty) OVERLAPS DATE ’1984-10-01’

-----Zaniolo--Ceri--Faloutsos--Snodgrass--Subrahmanian--Zicari--All Rights Reserved---


Advanced Database Systems Morgan Kaufmann
Copyright © 1995-7 Christian S. Jensen and Richard T. Snodgrass
Sec: 5.4.1 Temporal Databases - 20 -
RTS

Analogy: A Vita

Tom

Employment

Associate Professor July, 1989


Assistant Professor July, 1984
Instructor January, 1984

-----Zaniolo--Ceri--Faloutsos--Snodgrass--Subrahmanian--Zicari--All Rights Reserved---


Advanced Database Systems Morgan Kaufmann
Copyright © 1995-7 Christian S. Jensen and Richard T. Snodgrass
Sec: 5.4.1 Temporal Databases - 21 -
RTS

A Bitemporal Table

Transaction
Time

• Append-only
• Supports valid and transaction time
• Supports rollback coupled with
historical queries
• On October 1, 1984, what did we
think Tom’s rank was at that date?
SELECT Rank
FROM Faculty AS F
WHERE Name = ’Tom’
AND VALID(F) OVERLAPS DATE ’1984-10-01’
AND TRANSACTION(F) OVERLAPS DATE ’1984-10-01’

-----Zaniolo--Ceri--Faloutsos--Snodgrass--Subrahmanian--Zicari--All Rights Reserved---


Advanced Database Systems Morgan Kaufmann
Copyright © 1995-7 Christian S. Jensen and Richard T. Snodgrass
Sec: 5.4.1 Temporal Databases - 22 -
RTS

Analogy: A Stack of Vitæ

(January 1984 version)


Tom
Employment

Instructor January, 1984


(December 1984 version)
Tom
Employment

Assistant Professor July, 1984


Instructor January, 1984
(March 1989 version)
Tom
Employment

Associate Professor July, 1989


Assistant Professor July, 1984
Instructor January, 1984

-----Zaniolo--Ceri--Faloutsos--Snodgrass--Subrahmanian--Zicari--All Rights Reserved---


Advanced Database Systems Morgan Kaufmann
Copyright © 1995-7 Christian S. Jensen and Richard T. Snodgrass
Sec: 5.4.1 Temporal Databases - 23 -
RTS

Summary

• Several different structures of time


◆ Linear is simplest and most common.

• Five fundamental temporal data types

• Many different physical clocks

• Several dimensions of time


◆ Valid time
◆ Transaction time

-----Zaniolo--Ceri--Faloutsos--Snodgrass--Subrahmanian--Zicari--All Rights Reserved---


Advanced Database Systems Morgan Kaufmann
Copyright © 1995-7 Christian S. Jensen and Richard T. Snodgrass
Sec: 5.4-5.6 Temporal Databases -1 -
RTS

3. Temporal Data Models

• Overview of Temporal Data Models

• Design Space
◆ What is timestamped?

• Sample Data Models


◆ Tuple timestamping
◆ Attribute-value timestamping

• Objectives of a Data Model

-----Zaniolo--Ceri--Faloutsos--Snodgrass--Subrahmanian--Zicari--All Rights Reserved----


Advanced Database Systems Morgan Kaufmann
Copyright © 1995-7 Christian S. Jensen and Richard T. Snodgrass
Sec: 5.4-5.6 Temporal Databases -2 -
RTS

What Is Timestamped?

• Individual attribute value


• Groups of attribute values
• Individual tuple
• Object
• Set of tuples
◆ Generally used for transaction time, to
timestamp a set of tuples inserted or
modified by a transaction.
• Object graph
◆ E.g., associate a connected set of
modules (a configuration) with a
particular version identifier.
• Schema item

-----Zaniolo--Ceri--Faloutsos--Snodgrass--Subrahmanian--Zicari--All Rights Reserved----


Advanced Database Systems Morgan Kaufmann
Copyright © 1995-7 Christian S. Jensen and Richard T. Snodgrass
Sec: 5.4-5.6 Temporal Databases -3 -
RTS

Valid Time

SIngle Chronon Period Valid-time Element


(pair of chronons) (set of chronons)
ADM Baasioni Bhargava
Timestamped Caruso Gadia-2 Gadia-1
Attribute Values Lorentzos McKenzie HRDM
Tansel TOODM
Timestamped
Groups of Sciore-2
Attributes
Ariav Ahn
EDM Ben-Zvi
Timestamped HDM Jones
Tuples Lum Navathe BCDM
Sadeghi Sarda
Segev Snodgrass
Wiederhold Yau
Timestamped TEDM OSAM*/T
Objects TMAD

-----Zaniolo--Ceri--Faloutsos--Snodgrass--Subrahmanian--Zicari--All Rights Reserved----


Advanced Database Systems Morgan Kaufmann
Copyright © 1995-7 Christian S. Jensen and Richard T. Snodgrass
Sec: 5.4-5.6 Temporal Databases -4 -
RTS

Transaction Time

Single Chronon Period Three Transaction-time Element Other


(pair of chronons) Chronons (set of chronons)
Timestamped Bhargava
Attribute Caruso TOODM Sciore-1
Values
Timestamped
Groups of Sciore-2 OVM
Attributes
Ariav
Timestamped DATA Snodgrass
Tuples DM/T Postgres Ben-Zvi BCDM
EDM Yau
Lomet
Timestamped IRIS IRIS
Objects Kim
Timestamped ADM McKenzie
Sets of Tuples Ahn
Object Graph MATISSE MATISSE
Timestamped MATISSE McKenzie BCDM MATISSE
Schema Postgres

-----Zaniolo--Ceri--Faloutsos--Snodgrass--Subrahmanian--Zicari--All Rights Reserved----


Advanced Database Systems Morgan Kaufmann
Copyright © 1995-7 Christian S. Jensen and Richard T. Snodgrass
Sec: 5.4-5.6 Temporal Databases -5 -
RTS

Valid-time Data Models

• Tuple timestamping
◆ Attributes are atomic values and don’t
have any internal structure
◆ Single Chronon (e.g., Segev)

Name Dept Time


Eric Shoe 1
Eric Book 6
Eric Shoe 11
Eric Null 13

◆ Period timestamp (e.g., Sarda)

Name Dept Time


Eric Shoe [1-5]
Eric Book [6-10]
Eric Shoe [11-12]

-----Zaniolo--Ceri--Faloutsos--Snodgrass--Subrahmanian--Zicari--All Rights Reserved----


Advanced Database Systems Morgan Kaufmann
Copyright © 1995-7 Christian S. Jensen and Richard T. Snodgrass
Sec: 5.4-5.6 Temporal Databases -6 -
RTS

Valid-time Data Models, cont.

• Attribute-value Timestamping
◆ Functional, atomic valued (e.g., HRDM)

Name Dept
1 → Eric 1 → Shoe
... ...
12 → Eric 5 → Shoe
6 → Book
...
10 → Book
11 → Shoe
12 → Shoe

-----Zaniolo--Ceri--Faloutsos--Snodgrass--Subrahmanian--Zicari--All Rights Reserved----


Advanced Database Systems Morgan Kaufmann
Copyright © 1995-7 Christian S. Jensen and Richard T. Snodgrass
Sec: 5.4-5.6 Temporal Databases -7 -
RTS

Bitemporal Data Models

• Extensional data model

Name Dept Valid Time Transaction Time


Eric Shoe 1 1
Eric Shoe 2 1
... ... ... ...
Eric Shoe 1 2
Eric Shoe 2 2
... ... ... ...
Eric Book 6 8
Eric Book 7 8
... ... ... ...
Eric Book 6 9
Eric Book 7 9
... ... ... ...
Eric Book 6 10
... ... ... ...

-----Zaniolo--Ceri--Faloutsos--Snodgrass--Subrahmanian--Zicari--All Rights Reserved----


Advanced Database Systems Morgan Kaufmann
Copyright © 1995-7 Christian S. Jensen and Richard T. Snodgrass
Sec: 5.4-5.6 Temporal Databases -8 -
RTS

Bitemporal Data Models, cont.

• Attributes timestamped with sets of


pairs of bitemporal rectangles and
attribute values (e.g., Bhargava)

Name Dept
[1,11] x [1,∞] Eric [1,7] x [1,∞] Shoe

[12,➚] x [1,12] Eric [8,9] x [1,5] Shoe


[8,9] x [6,∞] Book

[10,10] x [1,5] Shoe


[10,10] x [6,10] Book

[11,11] x [1,5] Shoe


[11,11] x [6,10] Book
[11,11] x [11,∞] Shoe

[12,➚] x [1,5] Shoe


[12,➚] x [6,10] Book
[12,➚] x [11,12] Shoe
-----Zaniolo--Ceri--Faloutsos--Snodgrass--Subrahmanian--Zicari--All Rights Reserved----
Advanced Database Systems Morgan Kaufmann
Copyright © 1995-7 Christian S. Jensen and Richard T. Snodgrass
Sec: 5.4-5.6 Temporal Databases -9 -
RTS

Summary

-----Zaniolo--Ceri--Faloutsos--Snodgrass--Subrahmanian--Zicari--All Rights Reserved----


Advanced Database Systems Morgan Kaufmann
Copyright © 1995-7 Christian S. Jensen and Richard T. Snodgrass
Sec: 5.4-5.6 Temporal Databases - 10 -
RTS

Objectives of a Temporal Data


Model

• Capture the semantics of time-varying


information
• Retain simplicity of the relational
model
• Strict superset of the relational model
• Present all the information concerning
an object in a coherent fashion
• Ensure ease of implementation
• Ensure high performance
• Over 40 temporal data models and
associated temporal query languages
have been defined.

-----Zaniolo--Ceri--Faloutsos--Snodgrass--Subrahmanian--Zicari--All Rights Reserved----


• Design space has been fairly well
Advanced Database Systems Morgan Kaufmann
Copyright © 1995-7 Christian S. Jensen and Richard T. Snodgrass
covered.
Sec: 6.1-6.2 Temporal Databases -1 -
RTS

4. The Temporal Query


Language TSQL2

• Time Ontology

• Data Model

• Summary

-----Zaniolo--Ceri--Faloutsos--Snodgrass--Subrahmanian--Zicari--All Rights Reserved----


Advanced Database Systems Morgan Kaufmann
Copyright © 1995-7 Christian S. Jensen and Richard T. Snodgrass
Sec: 6.1-6.2 Temporal Databases -2 -
RTS

TSQL2 Time Ontology

• Structure
◆ TSQL2 uses a linear time structure.

• Boundedness
◆ The TSQL2 time line is bounded on both
ends, from the start of time to a point far
in the future.

-----Zaniolo--Ceri--Faloutsos--Snodgrass--Subrahmanian--Zicari--All Rights Reserved----


Advanced Database Systems Morgan Kaufmann
Copyright © 1995-7 Christian S. Jensen and Richard T. Snodgrass
Sec: 6.1-6.2 Temporal Databases -3 -
RTS

TSQL2 Time Ontology, cont.

• Density
◆ TSQL2 is designed to not differentiate
between the discrete, dense, and
continuous time ontologies. No questions
can be asked that give different answers.
✱ For example, you can’t ask if instant
a precedes instant b. You can only
ask if instant a precedes instant b at
some specified granularity. Different
granularities give different answers.
✱ It is a "don’t ask, don’t tell" time
model.

◆ Distance is defined in terms of number of


granules.

-----Zaniolo--Ceri--Faloutsos--Snodgrass--Subrahmanian--Zicari--All Rights Reserved----


Advanced Database Systems Morgan Kaufmann
Copyright © 1995-7 Christian S. Jensen and Richard T. Snodgrass
Sec: 6.1-6.2 Temporal Databases -4 -
RTS

Representing Time in TSQL2

• TSQL2 supports a bounded discrete


representation of the real time line.

• The TSQL2 time line is composed of


chronons, which is the smallest
granularity.

• Consecutive chronons may be


grouped together into granules,
yielding multiple granularities.

• A variety of granularities are available,


and it is possible to convert from one
granularity to another (via scaling).
-----Zaniolo--Ceri--Faloutsos--Snodgrass--Subrahmanian--Zicari--All Rights Reserved----
Advanced Database Systems Morgan Kaufmann
Copyright © 1995-7 Christian S. Jensen and Richard T. Snodgrass
Sec: 6.1-6.2 Temporal Databases -5 -
RTS

Temporal Data Types in TSQL2

• SQL92 Temporal Data Types


◆ DATE (YYYY-MM-DD)
◆ TIME (HH:MM:SS)
◆ DATETIME (YYYY-MM-DD HH:MM:SS)
◆ INTERVAL (no default
granularity)

• TSQL2
◆ PERIOD
✱ Datetime - Datetime

-----Zaniolo--Ceri--Faloutsos--Snodgrass--Subrahmanian--Zicari--All Rights Reserved----


Advanced Database Systems Morgan Kaufmann
Copyright © 1995-7 Christian S. Jensen and Richard T. Snodgrass
Sec: 6.1-6.2 Temporal Databases -6 -
RTS

TSQL2 Data Model

• Bitemporal Conceptual Data Model

• Fact based: each fact captured by one


tuple

• Two orthogonal dimensions of time


◆ Valid time
◆ Transaction time

• Tuples timestamped with bitemporal


elements
◆ Sets of bitemporal chronons

-----Zaniolo--Ceri--Faloutsos--Snodgrass--Subrahmanian--Zicari--All Rights Reserved----


Advanced Database Systems Morgan Kaufmann
Copyright © 1995-7 Christian S. Jensen and Richard T. Snodgrass
Sec: 6.1-6.2 Temporal Databases -7 -
RTS

Bitemporal Chronons in the


BCDM

Employee(Emp, Dept)

VT
30
(Kate, Ship)
25

20

15
(Jake, Ship) (Jake, Load)
10

5 10 15 20 25 30
TT
-----Zaniolo--Ceri--Faloutsos--Snodgrass--Subrahmanian--Zicari--All Rights Reserved----
Advanced Database Systems Morgan Kaufmann
Copyright © 1995-7 Christian S. Jensen and Richard T. Snodgrass
Sec: 6.1-6.2 Temporal Databases -8 -
RTS

BCDM Example, cont.

Emp Dept T
Jake Ship {(5,10),...,(5,15),...,(9,10),...,(9,15),
(10,5),...,(10,20),...,(14,5),...,(14,20),
(15,10),...,(15,15),...,(19,10),...,(19,15)}
Jake Load {(UC,10),...,(UC,15)}
Kate Ship {(UC,25),...,(UC,30)}

-----Zaniolo--Ceri--Faloutsos--Snodgrass--Subrahmanian--Zicari--All Rights Reserved----


Advanced Database Systems Morgan Kaufmann
Copyright © 1995-7 Christian S. Jensen and Richard T. Snodgrass
Sec: 6.1-6.2 Temporal Databases -9 -
RTS

Summary

• The TSQL2 Data Model


◆ Uses the BCDM for user-level queries
and for logical design.

◆ Uses representational data model(s) for


implementation.

◆ Uses presentational data models for


displaying the data.

◆ Uses snapshot equivalence to relate


instances in different models.

-----Zaniolo--Ceri--Faloutsos--Snodgrass--Subrahmanian--Zicari--All Rights Reserved----


Advanced Database Systems Morgan Kaufmann
Copyright © 1995-7 Christian S. Jensen and Richard T. Snodgrass
Sec: 6.3 Temporal Databases - 1 -
RTS

5. TSQL2 Language Constructs

• Schema Specification
• Snapshot Queries
• Snapshot Reducibility
• From Clause (Restructuring)
• Valid-Time Selection
• Valid-Time Projection
• Modification Statements
• Event Tables

-----Zaniolo--Ceri--Faloutsos--Snodgrass--Subrahmanian--Zicari--All Rights Reserved---


Advanced Database Systems Morgan Kaufmann
Copyright © 1995-7 Christian S. Jensen and Richard T. Snodgrass
Sec: 6.3 Temporal Databases - 2 -
RTS

Language Constructs, cont.

• Transaction Time
• Aggregates
• Schema Versioning
• Surrogates
• Temporal Indeterminacy
• Temporal Granularity
• Now
• Vacuuming

-----Zaniolo--Ceri--Faloutsos--Snodgrass--Subrahmanian--Zicari--All Rights Reserved---


Advanced Database Systems Morgan Kaufmann
Copyright © 1995-7 Christian S. Jensen and Richard T. Snodgrass
Sec: 6.3 Temporal Databases - 3 -
RTS

Schema Specification

• Scenario: Patient records are


computerized. These records include
information on the drugs prescribed to
each patient.
CREATE TABLE Prescription
(Name, Physician, Drug, Dosage,
Frequency INTERVAL MINUTE)
AS VALID DAY AND TRANSACTION

• The valid time specifies the period(s)


during which the drug was prescribed.

• The valid time has a granularity of day.

-----Zaniolo--Ceri--Faloutsos--Snodgrass--Subrahmanian--Zicari--All Rights Reserved---


Advanced Database Systems Morgan Kaufmann
Copyright © 1995-7 Christian S. Jensen and Richard T. Snodgrass
Sec: 6.3 Temporal Databases - 4 -
RTS

Schema Specification, cont.

• The transaction time specifies when


this information was recorded as
current information in the data base.

• The granularity of the transaction time


is system-dependent.

-----Zaniolo--Ceri--Faloutsos--Snodgrass--Subrahmanian--Zicari--All Rights Reserved---


Advanced Database Systems Morgan Kaufmann
Copyright © 1995-7 Christian S. Jensen and Richard T. Snodgrass
Sec: 6.3 Temporal Databases - 5 -
RTS

Schema Specification, cont.

• Kinds of tables
◆ Snapshot table: nothing after the
attributes
◆ Valid-time state table: AS VALID
[ STATE ] <granularity>
◆ Valid-time event table: AS VALID EVENT
<granularity>
◆ Transaction-time table: AS TRANSACTION
◆ Bitemporal state table: AS VALID
[ STATE ] <granularity> AND
TRANSACTION
◆ Bitemporal event table: AS VALID
EVENT <granularity> AND
TRANSACTION

• The type of a table can be changed at


any time, using the ALTER statement.

-----Zaniolo--Ceri--Faloutsos--Snodgrass--Subrahmanian--Zicari--All Rights Reserved---


Advanced Database Systems Morgan Kaufmann
Copyright © 1995-7 Christian S. Jensen and Richard T. Snodgrass
Sec: 6.3 Temporal Databases - 6 -
RTS

Snapshot Queries

• Who has been prescribed drugs?


SELECT SNAPSHOT Name
FROM Prescription

• Result is a list of names of those with


current or past prescriptions.
• Who is or was taking the drug
Proventil?

SELECT SNAPSHOT Name


FROM Prescription
WHERE Drug = ’Proventil’

• Result is a list of names.

-----Zaniolo--Ceri--Faloutsos--Snodgrass--Subrahmanian--Zicari--All Rights Reserved---


Advanced Database Systems Morgan Kaufmann
Copyright © 1995-7 Christian S. Jensen and Richard T. Snodgrass
Sec: 6.3 Temporal Databases - 7 -
RTS

Snapshot Reducibility

• Can request history, rather than just


current state.

• Who has been prescribed drugs, and


when?
SELECT Name
FROM Prescription

• Result is a list of names, each


associated with one or more maximal
periods.

-----Zaniolo--Ceri--Faloutsos--Snodgrass--Subrahmanian--Zicari--All Rights Reserved---


Advanced Database Systems Morgan Kaufmann
Copyright © 1995-7 Christian S. Jensen and Richard T. Snodgrass
Sec: 6.3 Temporal Databases - 8 -
RTS

Snapshot Reducibility, cont.

• What drugs have been prescribed with


Proventil?
SELECT P1.Name, P2.Drug
FROM Prescription AS P1, Prescription AS P2
WHERE P1.Drug = ’Proventil’
AND P2.Drug <> ‘Proventil’
AND P1.Name = P2.Name

• Result is a list of patient names and


drugs, along with their associated
maximal period(s).

-----Zaniolo--Ceri--Faloutsos--Snodgrass--Subrahmanian--Zicari--All Rights Reserved---


Advanced Database Systems Morgan Kaufmann
Copyright © 1995-7 Christian S. Jensen and Richard T. Snodgrass
Sec: 6.3 Temporal Databases - 9 -
RTS

From Clause

• Who has been on a drug for more than


a total of six months?

SELECT Name, Drug


FROM Prescription(Name, Drug) AS P
WHERE CAST(VALID(P) AS INTERVAL MONTH)
> INTERVAL ’6’ MONTH

• Result will contain the maximal


interval(s) when the patient has been
on the drug.

-----Zaniolo--Ceri--Faloutsos--Snodgrass--Subrahmanian--Zicari--All Rights Reserved---


Advanced Database Systems Morgan Kaufmann
Copyright © 1995-7 Christian S. Jensen and Richard T. Snodgrass
Sec: 6.3 Temporal Databases - 10 -
RTS

Restructuring, cont.

• Restructuring is (very useful!)


syntactic sugar.
FROM A(B, C, ...) AS A2

is equivalent to

FROM (SELECT B, C, ... FROM A) AS A2

• Nested SELECT projects on the


specified attributes, then
automatically coalesces the result.
• Other attributes in A are not accessible
via A2, and A is not accessible in the
enclosing SELECT.

-----Zaniolo--Ceri--Faloutsos--Snodgrass--Subrahmanian--Zicari--All Rights Reserved---


Advanced Database Systems Morgan Kaufmann
Copyright © 1995-7 Christian S. Jensen and Richard T. Snodgrass
Sec: 6.3 Temporal Databases - 11 -
RTS

Restructuring, cont.

• Correlation names can be coupled.


• Who has been on Proventil throughout
their drug regime?
SELECT SNAPSHOT P1.Name
FROM Prescription(Name) AS P1, P1(Drug) AS P2
WHERE P2.Drug = ’Proventil’
AND VALID(P2) = VALID(P1)

• P1 contains all the times that any drug


has been prescribed to a patient.
• P2 is coalesced on the Name and Drug
columns. Also, the values of the Name
column for both P1 and P2 are identical.

-----Zaniolo--Ceri--Faloutsos--Snodgrass--Subrahmanian--Zicari--All Rights Reserved---


Advanced Database Systems Morgan Kaufmann
Copyright © 1995-7 Christian S. Jensen and Richard T. Snodgrass
Sec: 6.3 Temporal Databases - 12 -
RTS

Restructuring, cont.

• This is also (again, useful) syntactic


sugar.

SELECT ...
FROM A(B,C,D) AS A2, A2(E,F) AS A3
WHERE ...

is equivalent to

SELECT ...
FROM (SELECT B,C,D FROM A) AS A2,
(SELECT B,C,D,E,F FROM A) AS A3
WHERE ...
AND A2.B = A3.B AND A2.C=A3.C
AND A2.D = A3.D
AND VALID(A2) OVERLAPS VALID(A3)

-----Zaniolo--Ceri--Faloutsos--Snodgrass--Subrahmanian--Zicari--All Rights Reserved---


Advanced Database Systems Morgan Kaufmann
Copyright © 1995-7 Christian S. Jensen and Richard T. Snodgrass
Sec: 6.3 Temporal Databases - 13 -
RTS

Restructuring, cont.

• Intuitively, A2 is timestamped with a


temporal element when attributes B, C,
and D remained constant, and A3
ranges over different values of D and
E, with the timestamp of A3 being a
subset of that of A2.

-----Zaniolo--Ceri--Faloutsos--Snodgrass--Subrahmanian--Zicari--All Rights Reserved---


Advanced Database Systems Morgan Kaufmann
Copyright © 1995-7 Christian S. Jensen and Richard T. Snodgrass
Sec: 6.3 Temporal Databases - 14 -
RTS

Restructuring, cont.

• Restructuring provides many of the


benefits of an attribute timestamped
data model.
Name Dept Manager
’Melanie’ [1-18) ’Toy’ [1-10) ’LeeAnn’ [1-8)
’Shoe’ [10-18) ’Eric’ [8-18)
’Tom’ [5-20) ’Toy’ [5-15) ’LeeAnn’ [5-8)
’Shoe’ [15-20) ’Eric’ [8-20)

• The same information can be


expressed in the TSQL2 data model.
Name Dept Manager Valid Time
’Melanie’ ’Toy’ ’LeeAnn’ {[1-8)}
’Melanie’ ’Toy’ ’Eric’ {[8-10)}
’Melanie’ ’Shoe’ ’Eric’ {[10-18)}
’Tom’ ’Toy’ ’LeeAnn’ {[5-8)}
’Tom’ ’Toy’ ’Eric’ {[8-15)}
’Tom’ ’Shoe’ ’Eric’ {[15-20)}

-----Zaniolo--Ceri--Faloutsos--Snodgrass--Subrahmanian--Zicari--All Rights Reserved---


Advanced Database Systems Morgan Kaufmann
Copyright © 1995-7 Christian S. Jensen and Richard T. Snodgrass
Sec: 6.3 Temporal Databases - 15 -
RTS

Restructuring Example, cont.

• To get the “department history”,


restructure on Name and Dept.
FROM Emp(Name) AS E1, E1(Dept) AS E2

E1.Name = ’Melanie’ [1-18)


E2.Dept = ’Toy’ [1-10)
E2.Dept = ’Shoe’ [10-18)

E1.Name = ’Tom’ [5-20)


E2.Dept = ’Toy’ [5-15)
E2.Dept = ’Shoe’ [15-20)

• To get the “manager history”,


restructure on Name and Manager.
FROM Emp(Name) AS E1, E1(Manager) AS E2

E1.Name = ’Melanie’ [1-18)


E2.Manager = ’LeeAnn’ [1-8)
E2.Manager = ’Eric’ [8-18)

E1.Name = ’Tom’ [5-20)


E2.Manager = ’LeeAnn’ [5-8)
E2.Manager = ’Eric’ [8-20)

-----Zaniolo--Ceri--Faloutsos--Snodgrass--Subrahmanian--Zicari--All Rights Reserved---


Advanced Database Systems Morgan Kaufmann
Copyright © 1995-7 Christian S. Jensen and Richard T. Snodgrass
Sec: 6.3 Temporal Databases - 16 -
RTS

Restructuring Example, cont.

• To simultaneously get the department


and manager histories for the
employees,

FROM Emp(Name) AS E1, E1(Dept) AS E2,


E1(Manager) AS E3

E1.Name = ’Melanie’ [1-18)


E2.Dept = ’Toy’ [1-10)
E2.Dept = ’Shoe’ [10-18)

E3.Manager = ’LeeAnn’ [1-8)


E3.Manager = ’Eric’ [8-18)

E1.Name = ’Tom’ [5-20)


E2.Dept = ’Toy’ [5-15)
E2.Dept = ’Shoe’ [15-20)

E3.Manager = ’LeeAnn’ [5-8)


E3.Manager = ’Eric’ [8-20)

-----Zaniolo--Ceri--Faloutsos--Snodgrass--Subrahmanian--Zicari--All Rights Reserved---


Advanced Database Systems Morgan Kaufmann
Copyright © 1995-7 Christian S. Jensen and Richard T. Snodgrass
Sec: 6.3 Temporal Databases - 17 -
RTS

Restructuring Example, cont.

• To get the history of the members of a


department,
FROM Emp(Dept) AS E1, E1(Name) AS E2

E1.Dept = ’Toy’ [1-15)


E2.Name = ’Melanie’ [1-10)
E2.Name = ’Tom’ [5-15)

E1.Dept = ’Shoe’ [10-20)


E2.Name = ’Melanie’ [10-18)
E2.Name = ’Tom’ [15-20)

• To get the history of the managers


associated with a department,

FROM Emp(Dept) AS E1, E1(Manager) AS E2

E1.Dept = ’Toy’ [1-15)


E2.Name = ’LeeAnn’ [1-8)
E2.Name = ’Eric’ [8-15)

E1.Dept = ’Shoe’ [10-20)


E2.Name = ’Eric’ [10-20)

-----Zaniolo--Ceri--Faloutsos--Snodgrass--Subrahmanian--Zicari--All Rights Reserved---


Advanced Database Systems Morgan Kaufmann
Copyright © 1995-7 Christian S. Jensen and Richard T. Snodgrass
Sec: 6.3 Temporal Databases - 18 -
RTS

Restructuring Example, cont.

• To get the history of the employees


managed by a manager,
FROM Emp(Manager) AS E1, E1(Name) AS E2

E1.Manager = ’LeeAnn’ [1-8)


E2.Name = ’Melanie’ [1-8)
E2.Name = ’Tom’ [5-8)

E1.Manager = ’Eric’ [8-20)


E2.Name = ’Melanie’ [8-18)
E2.Name = ’Tom’ [8-20)

• To get the history of the departments


associated with a manager,

FROM Emp(Manager) AS E1, E1(Dept) AS E2

E1.Manager = ’LeeAnn’ [1-8)


E2.Dept = ’Toy’ [1-8)

E1.Manager = ’Eric’ [8-20)


E2.Dept = ’Toy’ [8-15)
E2.Dept = ’Shoe’ [10-20)

-----Zaniolo--Ceri--Faloutsos--Snodgrass--Subrahmanian--Zicari--All Rights Reserved---


Advanced Database Systems Morgan Kaufmann
Copyright © 1995-7 Christian S. Jensen and Richard T. Snodgrass
Sec: 6.3 Temporal Databases - 19 -
RTS

Partitioning

• Who has been on the same drug for


more than six consecutive months?
SELECT SNAPSHOT Name, Drug, VALID(P)
FROM Prescription(Name, Drug)(PERIOD) AS P
WHERE CAST(VALID(P) AS INTERVAL MONTH)
> INTERVAL ’6’ MONTH

• P ranges over Name-Drug pairs


associated with individual maximal
periods.
• The result may contain several rows
with the same Name and Drug values.
• The result is a snapshot table, with a
PERIOD value in the last column.

-----Zaniolo--Ceri--Faloutsos--Snodgrass--Subrahmanian--Zicari--All Rights Reserved---


Advanced Database Systems Morgan Kaufmann
Copyright © 1995-7 Christian S. Jensen and Richard T. Snodgrass
Sec: 6.3 Temporal Databases - 20 -
RTS

Partitioning, cont.

• Partitioning is not syntactic sugar.

• It violates the data model, in that it


produces value-equivalent tuples that
the correlation name ranges over.

• Note, however, that underlying tables


and the result table are always
coalesced so that the violation is
temporary and internal to a query.

• Useful for queries referencing a


“consecutive” time or “continuously”.

-----Zaniolo--Ceri--Faloutsos--Snodgrass--Subrahmanian--Zicari--All Rights Reserved---


Advanced Database Systems Morgan Kaufmann
Copyright © 1995-7 Christian S. Jensen and Richard T. Snodgrass
Sec: 6.3 Temporal Databases - 21 -
RTS

Valid-Time Selection

• The valid timestamp of a tuple


associated with a correlation name A
is specified with VALID(A).
◆ For state tables associated with
unpartitioned correlation names, this
evaluates to a temporal element.
◆ Cannot be solely used in a select clause
to specify the value of a column.
◆ For state tables partitioned by (PERIOD),
this evaluates to a period.

• The various temporal element, period,


etc., operators can then be used on
such values, within the select clause,
the where clause, and the having
clause.

-----Zaniolo--Ceri--Faloutsos--Snodgrass--Subrahmanian--Zicari--All Rights Reserved---


Advanced Database Systems Morgan Kaufmann
Copyright © 1995-7 Christian S. Jensen and Richard T. Snodgrass
Sec: 6.3 Temporal Databases - 22 -
RTS

Valid-Time Projection

• A new clause, the VALID clause,


specifies the timestamp of the
resulting tuple.
• What drugs was Melanie prescribed
during 1994?
SELECT Drug
VALID INTERSECT(VALID(Prescription),
PERIOD ’[1994]’ DAY)
FROM Prescription
WHERE Name = ’Melanie’

• The result is a list of drugs, each


associated with a set of the periods
during 1994 that they were prescribed
to Melanie.

-----Zaniolo--Ceri--Faloutsos--Snodgrass--Subrahmanian--Zicari--All Rights Reserved---


Advanced Database Systems Morgan Kaufmann
Copyright © 1995-7 Christian S. Jensen and Richard T. Snodgrass
Sec: 6.3 Temporal Databases - 23 -
RTS

Modification Statements

• The valid times can be specified for


rows that are being inserted.
INSERT INTO Prescription
VALUES (’Sally’,’Dr. Beren’,’Proventil’,’100 mg’,
INTERVAL ’8:00’ MINUTE)
VALID PERIOD ’[1993/01/01 - 1993/06/30]’

• Inserted values will be coalesced with


existing value-equivalent rows.
• Default valid clause:
VALID PERIOD(CURRENT_TIMESTAMP,
NOBIND(TIMESTAMP ’now’))
• An INSERT statement with a subquery
is handled in the same manner.

-----Zaniolo--Ceri--Faloutsos--Snodgrass--Subrahmanian--Zicari--All Rights Reserved---


Advanced Database Systems Morgan Kaufmann
Copyright © 1995-7 Christian S. Jensen and Richard T. Snodgrass
Sec: 6.3 Temporal Databases - 24 -
RTS

Modification Statements, cont.

• The delete statement removes


period(s) from the temporal element
of the qualifying row(s).
DELETE FROM Prescription
WHERE Name = ’Melanie’
VALID PERIOD ’[1993-06-01 - 1993-06-30]’

• If the temporal element becomes


empty, the row itself is deleted.
• The columns of a row can be changed,
as in SQL-92.

UPDATE Prescription
SET Dosage TO ’50 mg’
WHERE Name = ’Melanie’
AND Drug = ’Proventil’

-----Zaniolo--Ceri--Faloutsos--Snodgrass--Subrahmanian--Zicari--All Rights Reserved---


Advanced Database Systems Morgan Kaufmann
Copyright © 1995-7 Christian S. Jensen and Richard T. Snodgrass
Sec: 6.3 Temporal Databases - 25 -
RTS

Modification statements, cont.

• The valid time of a row can also be


changed.

UPDATE Prescription
SET Dosage TO ’50 mg’
VALID PERIOD ’[1993-03-01 - 1993-05-30]’
WHERE Name = ’Melanie’
AND Drug = ’Proventil’

-----Zaniolo--Ceri--Faloutsos--Snodgrass--Subrahmanian--Zicari--All Rights Reserved---


Advanced Database Systems Morgan Kaufmann
Copyright © 1995-7 Christian S. Jensen and Richard T. Snodgrass
Sec: 6.3 Temporal Databases - 26 -
RTS

Modification Statements, cont.

30 30
Original now

DELETE

30 30 30
yields

30 30 30 50
UPDATE
yields

50
UPDATE
with valid time

30 50 50 30 50
yields

-----Zaniolo--Ceri--Faloutsos--Snodgrass--Subrahmanian--Zicari--All Rights Reserved---


Advanced Database Systems Morgan Kaufmann
Copyright © 1995-7 Christian S. Jensen and Richard T. Snodgrass
Sec: 6.3 Temporal Databases - 27 -
RTS

Event Tables

• Event tables are timestamped with


instant sets.
• Each row identifies a particular kind
of (instantaneous) event, with the
timestamp of that row specifying the
instant(s) when that event occurred.
• Event tables may also be associated
with transaction time.

CREATE TABLE LabTest (Name, Physician, TestID)


AS VALID EVENT HOUR AND TRANSACTION

-----Zaniolo--Ceri--Faloutsos--Snodgrass--Subrahmanian--Zicari--All Rights Reserved---


Advanced Database Systems Morgan Kaufmann
Copyright © 1995-7 Christian S. Jensen and Richard T. Snodgrass
Sec: 6.3 Temporal Databases - 28 -
RTS

Event Tables, cont.

• Such tables can be restructured and


partitioned in the FROM clause.
◆ FROM LabTest will have the
VALID(LabTest) return an instant set.
◆ FROM LabTest(INSTANT) will have
VALID(LabTest) return a single datetime.

-----Zaniolo--Ceri--Faloutsos--Snodgrass--Subrahmanian--Zicari--All Rights Reserved---


Advanced Database Systems Morgan Kaufmann
Copyright © 1995-7 Christian S. Jensen and Richard T. Snodgrass
Sec: 6.3 Temporal Databases - 29 -
RTS

Event Tables, cont.

• Were any patients the sole


receivers of tests ordered by a
physician?

SELECT L1.Name, L2.Physician


FROM LabTest(Name) AS L1, L1(Physician) AS L2,
LabTest(Physician) AS L3
WHERE VALID(L1) = VALID(L2)
AND L2.Physician = L3.Physician
AND VALID(L1) = VALID(L3)

• VALID(L1) is an event set


containing all tests done to a
particular patient.

-----Zaniolo--Ceri--Faloutsos--Snodgrass--Subrahmanian--Zicari--All Rights Reserved---


Advanced Database Systems Morgan Kaufmann
Copyright © 1995-7 Christian S. Jensen and Richard T. Snodgrass
Sec: 6.3 Temporal Databases - 30 -
RTS

Event Tables, cont.

• VALID(L2) contains the times of all


tests done to a particular patient and
ordered by a particular physician.

• VALID(L3) is an event set containing


all tests ordered by a particular
physician.

-----Zaniolo--Ceri--Faloutsos--Snodgrass--Subrahmanian--Zicari--All Rights Reserved---


Advanced Database Systems Morgan Kaufmann
Copyright © 1995-7 Christian S. Jensen and Richard T. Snodgrass
Sec: 6.3 Temporal Databases - 31 -
RTS

Transaction Time

• If transaction time is not mentioned in


the query, the results include only the
information currently believed to be
true.
• What is Melanie’s prescription
history?
SELECT Drug
FROM Prescription
WHERE Name = ’Melanie’
• Can also rollback the database.
• What did the physician believe on
June 1, 1994 was Melanie’s
prescription history?

SELECT Drug
FROM Prescription AS P
WHERE Name = ’Melanie’
AND TRANSACTION(P) OVERLAPS DATE ’1994-06-01’

-----Zaniolo--Ceri--Faloutsos--Snodgrass--Subrahmanian--Zicari--All Rights Reserved---


Advanced Database Systems Morgan Kaufmann
Copyright © 1995-7 Christian S. Jensen and Richard T. Snodgrass
Sec: 6.3 Temporal Databases - 32 -
RTS

Transaction Time, cont.

• Auditing can be done on previously


corrected data.
• When was Melanie’s data valid on
January 1, 1993 last corrected?

SELECT SNAPSHOT BEGIN(TRANSACTION(P2))


FROM Prescription AS P P2
WHERE P1.Name = ’Melanie’ AND P1.Name = P2.Name
AND VALID(P1) OVERLAPS DATE ’1993-01-01’
AND VALID(P2) OVERLAPS DATE ’1993-01-01’
AND TRANSACTION(P1) MEETS TRANSACTION(P2)

-----Zaniolo--Ceri--Faloutsos--Snodgrass--Subrahmanian--Zicari--All Rights Reserved---


Advanced Database Systems Morgan Kaufmann
Copyright © 1995-7 Christian S. Jensen and Richard T. Snodgrass
Sec: 6.3 Temporal Databases - 33 -
RTS

Transaction Time, cont.

• The transaction timestamp is specified


with TRANSACTION(name), and
evaluates to a period.
• What was recorded as current on
March 1 about Melanie?
SELECT SNAPSHOT Drug
FROM Prescription AS P
WHERE Name = ’Melanie’
AND TRANSACTION(P) OVERLAPS DATE ’1995-03-01’
AND VALID(P) OVERLAPS DATE ’1995-03-01’

• The default is

AND TRANSACTION(...) OVERLAPS


CURRENT_TIMESTAMP

-----Zaniolo--Ceri--Faloutsos--Snodgrass--Subrahmanian--Zicari--All Rights Reserved---


Advanced Database Systems Morgan Kaufmann
Copyright © 1995-7 Christian S. Jensen and Richard T. Snodgrass
Sec: 6.3 Temporal Databases - 34 -
RTS

Aggregates

• SQL-92 supports the aggregates MIN,


MAX, COUNT, SUM, and AVG.

• Snapshot reducibility implies that


these aggregates return time-varying
results when applied to temporal
tables.
◆ The aggregate is applied to each
snapshot in turn.
◆ Evaluation can be optimized, as many
snapshots will contain the same rows,
and hence evaluate to the same result.

-----Zaniolo--Ceri--Faloutsos--Snodgrass--Subrahmanian--Zicari--All Rights Reserved---


Advanced Database Systems Morgan Kaufmann
Copyright © 1995-7 Christian S. Jensen and Richard T. Snodgrass
Sec: 6.3 Temporal Databases - 35 -
RTS

Aggregates, cont.

• How many drugs is/was Melanie


taking?

SELECT COUNT(*)
FROM Prescription
WHERE Name = ’Melanie’
AND Drug = ’Proventil"

◆ When was Melanie’s Proventil dosage


rising the longest?

• This query will return a valid-time


table providing a time-varying count
of the number of prescriptions valid at
any point in time.

-----Zaniolo--Ceri--Faloutsos--Snodgrass--Subrahmanian--Zicari--All Rights Reserved---


Advanced Database Systems Morgan Kaufmann
Copyright © 1995-7 Christian S. Jensen and Richard T. Snodgrass
Sec: 6.3 Temporal Databases - 36 -
RTS

Aggregates, cont.

• Aggregates can also have a GROUP


BY clause.
• How many people are taking each
drug?
SELECT Drug, COUNT(*)
FROM Prescription
GROUP BY Drug

• Again, the result is a temporal table.

-----Zaniolo--Ceri--Faloutsos--Snodgrass--Subrahmanian--Zicari--All Rights Reserved---


Advanced Database Systems Morgan Kaufmann
Copyright © 1995-7 Christian S. Jensen and Richard T. Snodgrass
Sec: 6.3 Temporal Databases - 37 -
RTS

Aggregates, cont.

• TSQL2 adds one aggregate, RISING.


This evaluates to the longest period
during which a column was
monotonically rising.

SELECT SNAPSHOT RISING(Dosage)


FROM Prescription
WHERE Name = ’Sally’ AND Drug = ’Proventil’

-----Zaniolo--Ceri--Faloutsos--Snodgrass--Subrahmanian--Zicari--All Rights Reserved---


Advanced Database Systems Morgan Kaufmann
Copyright © 1995-7 Christian S. Jensen and Richard T. Snodgrass
Sec: 6.3 Temporal Databases - 38 -
RTS

Schema Versioning

• In SQL-92, a schema change causes the


previous schema to be lost.

• In TSQL2, if the table is a transaction-


time or bitemporal table, the schema is
versioned.

• Effectively, the schema itself become a


set of transaction-time tables.

-----Zaniolo--Ceri--Faloutsos--Snodgrass--Subrahmanian--Zicari--All Rights Reserved---


Advanced Database Systems Morgan Kaufmann
Copyright © 1995-7 Christian S. Jensen and Richard T. Snodgrass
Sec: 6.3 Temporal Databases - 39 -
RTS

Schema Versioning, cont.

• On May 20, 1995, a column was


added to the Prescription table to
record the identifier number for the
prescription.

ALTER TABLE Prescription


ADD COLUMN Identifier NUMERIC

• Both the previous schema (with


5 columns) and the new schema (with
6 columns) are retained.

• Since data in a table supporting


transaction time cannot be modified
after it is stored (as the table is
append-only), a schema change can
affect only future data.

-----Zaniolo--Ceri--Faloutsos--Snodgrass--Subrahmanian--Zicari--All Rights Reserved---


Advanced Database Systems Morgan Kaufmann
Copyright © 1995-7 Christian S. Jensen and Richard T. Snodgrass
Sec: 6.3 Temporal Databases - 40 -
RTS

Schema Versioning, cont.

• Legacy applications may want to use


an old schema, in force when the
application was developed.
SET SCHEMA DATE ’1995-04-19’
• Queries referencing old transaction
times may access data of a different
schema.

• TSQL2 transforms data of a different


schema into the schema associated
with the query.

• Some schema changes cannot be


accommodated. In those situations,
the query’s schema must match the
data’s schema.

-----Zaniolo--Ceri--Faloutsos--Snodgrass--Subrahmanian--Zicari--All Rights Reserved---


Advanced Database Systems Morgan Kaufmann
Copyright © 1995-7 Christian S. Jensen and Richard T. Snodgrass
Sec: 6.4 Temporal Databases - 41 -
RTS

Surrogates

• A surrogate is a unique value that can


be compared for equality, but is
otherwise not visible to users.
• Surrogates are useful for identifying
objects when the primary key of the
object is time-varying.
• The surrogate is a column data type.

CREATE TABLE Patient (Name CHAR, Id SURROGATE)


AS VALID DAY

INSERT INTO Patient VALUES (’Bob’, NEW)


VALID PERIOD ’[01/01/90 - 01/01/1994]’)

-----Zaniolo--Ceri--Faloutsos--Snodgrass--Subrahmanian--Zicari--All Rights Reserved---


Advanced Database Systems Morgan Kaufmann
Copyright © 1995-7 Christian S. Jensen and Richard T. Snodgrass
Sec: 6.4 Temporal Databases - 42 -
RTS

Surrogates, cont.

• The reserved word NEW indicates that


the system must supply a surrogate
value that has never been used before.

• To change the name of an existing


patient, reuse the Id.

UPDATE Patient
SET Name = ’Robert’
WHERE Name = ’Bob’

-----Zaniolo--Ceri--Faloutsos--Snodgrass--Subrahmanian--Zicari--All Rights Reserved---


Advanced Database Systems Morgan Kaufmann
Copyright © 1995-7 Christian S. Jensen and Richard T. Snodgrass
Sec: 6.4 Temporal Databases - 43 -
RTS

Temporal Granularity

• Granularities are provided by


calendars, which are specified by the
DBA.
• Granularities form a lattice, which
ensures that it is possible to convert a
temporal value in any granularity into
any other granularity.
• Calendars are gathered into calendric
systems, which are specified by the
user. The default is:

SET CALENDRIC SYSTEM SQL-92

• The granularity is identified when the


column or literal is specified.

TIMESTAMP ’1994-04-19 15:24’ MINUTE

-----Zaniolo--Ceri--Faloutsos--Snodgrass--Subrahmanian--Zicari--All Rights Reserved---


Advanced Database Systems Morgan Kaufmann
Copyright © 1995-7 Christian S. Jensen and Richard T. Snodgrass
Sec: 6.4 Temporal Databases - 44 -
RTS

Temporal Granularity, cont.

• Operands of predicates (e.g.,


PRECEDES) must be comparable,
i.e, must have the same granularity.
• These predicates are performed at this
implicit granularity.
• The user can change the granularity of
the operands, and thus of the operation.
• CAST(expression AS granularity)
results in a determinate value at
granularity if expression is determinate.
• CAST(TIMESTAMP ’1994 -04-19 15:24’ MINUTE
AS HOUR)
results in
TIMESTAMP ’1994-04-19 15’ HOUR.

-----Zaniolo--Ceri--Faloutsos--Snodgrass--Subrahmanian--Zicari--All Rights Reserved---


Advanced Database Systems Morgan Kaufmann
Copyright © 1995-7 Christian S. Jensen and Richard T. Snodgrass
Sec: 6.4 Temporal Databases - 45 -
RTS

Temporal Indeterminacy

• Temporal indeterminacy is "don’t


know when" information.
-- e.g., "between 2PM and 4PM"
-- "around the middle of August"
• Interacts closely with granularity.
-- "sometime the first week in January,
1995" is indeterminate at a granularity of
days, but is determinate at the granularity
of weeks.

• Impact on the language


-- Add indeterminacy to the data model
-- Add indeterminacy to temporal literals
-- Add indeterminacy to predicates and
constructors

-----Zaniolo--Ceri--Faloutsos--Snodgrass--Subrahmanian--Zicari--All Rights Reserved---


Advanced Database Systems Morgan Kaufmann
Copyright © 1995-7 Christian S. Jensen and Richard T. Snodgrass
Sec: 6.4 Temporal Databases - 46 -
RTS

Now

• SQL-92 includes CURRENT_DATE,


CURRENT_TIME, and
CURRENT_TIMESTAMP.
• SQL-92 evaluates these during query
execution. These values cannot be
stored in the database.

• Eric just became a new patient.


INSERT INTO Patient
VALUES (’Eric’, NEW)
VALID PERIOD(CURRENT_DATE, ??)

• TSQL2 allows now-relative variables


to be stored in the database.

-----Zaniolo--Ceri--Faloutsos--Snodgrass--Subrahmanian--Zicari--All Rights Reserved---


Advanced Database Systems Morgan Kaufmann
Copyright © 1995-7 Christian S. Jensen and Richard T. Snodgrass
Sec: 6.4 Temporal Databases - 47 -
RTS

Vacuuming

• Tables supporting transaction time are


append-only. Hence, they grow
monotonically.
-- Data could out-grow available storage
media.
-- Many countries have strict laws
necessitate physical deletion, e.g., by
preventing that particular data is retained
longer than a specified time.
-- More data means slower querying and
update.

• There is the need for a capability to


vacuum the database of no-longer
useful data.

-----Zaniolo--Ceri--Faloutsos--Snodgrass--Subrahmanian--Zicari--All Rights Reserved---


Advanced Database Systems Morgan Kaufmann
Copyright © 1995-7 Christian S. Jensen and Richard T. Snodgrass
Sec: 6.4 Temporal Databases - 48 -
RTS

Vacuuming, cont.

• Vacuuming removes old, possibly


obsolete and incorrect data.
-- Data with a transaction end time of now
will never be vacuumed.
-- Old valid times can be removed with
DELETE.

• The physical vacuuming can occur


asynchronously, any time after the
ALTER statement.

-----Zaniolo--Ceri--Faloutsos--Snodgrass--Subrahmanian--Zicari--All Rights Reserved---


Advanced Database Systems Morgan Kaufmann
Copyright © 1995-7 Christian S. Jensen and Richard T. Snodgrass
Sec: 6.5 Temporal Databases - 49 -
RTS

Summary

• State tables are timestamped with


temporal elements, which are sets of
periods.

• Conventional (non-time-varying)
tables can be derived from time-
varying tables by specifying
SNAPSHOT in the select clause.
Conventional tables can also
participate along with time-varying
tables in a select statement.

• Periods are anchored durations of


time. This is a new data type,
augmenting SQL’s datetimes and
intervals.

-----Zaniolo--Ceri--Faloutsos--Snodgrass--Subrahmanian--Zicari--All Rights Reserved---


Advanced Database Systems Morgan Kaufmann
Copyright © 1995-7 Christian S. Jensen and Richard T. Snodgrass
Sec: 6.5 Temporal Databases - 50 -
RTS

Summary, cont.

• Restructuring merges the timestamps


of value-equivalent rows, and is
specified by listing column names in
the from clause.

• Coupled correlation names permit a


further restructuring on additional
columns, while ensuring that the rows
associated with the two correlation
names agree on the values of the
original coalescing columns.

• Partitioning extracts maximal


period(s) from a temporal element
timestamp for a row, and is specified
by (PERIOD) in the from clause.

-----Zaniolo--Ceri--Faloutsos--Snodgrass--Subrahmanian--Zicari--All Rights Reserved---


Advanced Database Systems Morgan Kaufmann
Copyright © 1995-7 Christian S. Jensen and Richard T. Snodgrass
Sec: 6.5 Temporal Databases - 51 -
RTS

Summary, cont.

• Valid-time selection enables rows to


be selected by means of predicates on
their timestamps, within the where
clause.

• Valid-time projection specifies the


period of validity of a derived table,
via the valid clause.

• Event tables are timestamped with


sets of instants.

• Bitemporal tables are timestamped


with both valid time and transaction
time.

-----Zaniolo--Ceri--Faloutsos--Snodgrass--Subrahmanian--Zicari--All Rights Reserved---


Advanced Database Systems Morgan Kaufmann
Copyright © 1995-7 Christian S. Jensen and Richard T. Snodgrass
Sec: 6.5 Temporal Databases - 52 -
RTS

Summary, cont.

• Surrogates identify objects when the


primary key is time varying.

• A granularity is a partitioning of the


time line.

• Calendars provide a collection of


granularities, and participate in
parsing and output of timestamp
literals.

• Temporal indeterminacy is supported


in the data model.

-----Zaniolo--Ceri--Faloutsos--Snodgrass--Subrahmanian--Zicari--All Rights Reserved---


Advanced Database Systems Morgan Kaufmann
Copyright © 1995-7 Christian S. Jensen and Richard T. Snodgrass
Sec: 6.5 Temporal Databases - 53 -
RTS

Summary, cont.

• Now-relative times are bound during


query evaluation.

• Time-varying aggregates can be


computed. Grouping can be over
columns or over row timestamps.

• Transaction-time selection permits


specification of previous versions.

• Schema versioning allows tables


timestamped with transaction time to
be accessed and modified through
previous schemas, thereby supporting
legacy applications.

-----Zaniolo--Ceri--Faloutsos--Snodgrass--Subrahmanian--Zicari--All Rights Reserved---


Advanced Database Systems Morgan Kaufmann
Copyright © 1995-7 Christian S. Jensen and Richard T. Snodgrass
Sec: 6.5 Temporal Databases - 54 -
RTS

Summary, cont.

• Tables timestamped with transaction


time may be vacuumed to remove old
versions.

-----Zaniolo--Ceri--Faloutsos--Snodgrass--Subrahmanian--Zicari--All Rights Reserved---


Advanced Database Systems Morgan Kaufmann
Copyright © 1995-7 Christian S. Jensen and Richard T. Snodgrass
Sec: 7 Temporal Databases -1 -
RTS

6. Temporal DBMS
Implementation

• Architecture

• Extending the Architecture


◆ Query compiler
◆ Run-time evaluator

• A Temporal Algebra

• Operator Implementations
◆ Temporal joins
◆ Coalescing

• Temporal Indexing

-----Zaniolo--Ceri--Faloutsos--Snodgrass--Subrahmanian--Zicari--All Rights Reserved----


Advanced Database Systems Morgan Kaufmann
Copyright © 1995-7 Christian S. Jensen and Richard T. Snodgrass
Sec: 7 Temporal Databases -2 -
RTS

Conventional Architecture

Application
Programmers

Application
Programs
Casual Parametric
DBA Staff Users Users
Precompiler

DDL Privileged Interactive


Statements Commands Query Host Language
Compiler

DML Canned
Statements Transactions
DDL
Compiler
Query
Compiler

Query Execution
Plan

Run-time
Evaluator

Transaction
and
Data Manager
DBMS

Data Data
Dictionary Files

-----Zaniolo--Ceri--Faloutsos--Snodgrass--Subrahmanian--Zicari--All Rights Reserved----


Advanced Database Systems Morgan Kaufmann
Copyright © 1995-7 Christian S. Jensen and Richard T. Snodgrass
Sec: 7 Temporal Databases -3 -
RTS

Extending the Architecture:


Goals

• Minimal extension

• Retain good performance

• Permit multiple representational data


models

-----Zaniolo--Ceri--Faloutsos--Snodgrass--Subrahmanian--Zicari--All Rights Reserved----


Advanced Database Systems Morgan Kaufmann
Copyright © 1995-7 Christian S. Jensen and Richard T. Snodgrass
Sec: 7 Temporal Databases -4 -
RTS

Query Compiler

• Syntactic analysis
◆ Syntax has been extended.
• Semantic analysis
◆ New data types (period, temporal
element)
◆ Multiple granularities and implicit
CASTs and SCALEs
• Query rewrite optimization
◆ Contend with new predicates (easy)
◆ Snapshot reducible queries have identical
semantics in rewrite phase.
◆ Non-snapshot reducible queries are also
easy to accommodate.
◆ Must be extended to include vacuuming
cut-offs

-----Zaniolo--Ceri--Faloutsos--Snodgrass--Subrahmanian--Zicari--All Rights Reserved----


Advanced Database Systems Morgan Kaufmann
Copyright © 1995-7 Christian S. Jensen and Richard T. Snodgrass
Sec: 7 Temporal Databases -5 -
RTS

Query Compiler, cont.

• Query execution plan generation


◆ Snapshot reducible queries generate
temporal algebraic operators.
◆ Other queries generate conventional
algebraic operators.
◆ Some temporal element operators
(e.g., CONTAINS) require special care.

• Algebraic optimizations
◆ Algebraic operators (both temporal and
conventional) satisfy existing tautologies.
◆ Few changes to (complex) query
optimizer
◆ Cost functions may need to be adjusted
for temporal operators.

-----Zaniolo--Ceri--Faloutsos--Snodgrass--Subrahmanian--Zicari--All Rights Reserved----


Advanced Database Systems Morgan Kaufmann
Copyright © 1995-7 Christian S. Jensen and Richard T. Snodgrass
Sec: 7 Temporal Databases -6 -
RTS

Run-time Evaluator

• Initial representation: a tuple


timestamped with a temporal element
is represented as a set of value-
equivalent tuples, each time-stamped
with a maximal period.

• Requires no changes to storage


structures or access methods

• Some operators require that temporal


elements be constructed during query
evaluation (coalescing).

-----Zaniolo--Ceri--Faloutsos--Snodgrass--Subrahmanian--Zicari--All Rights Reserved----


Advanced Database Systems Morgan Kaufmann
Copyright © 1995-7 Christian S. Jensen and Richard T. Snodgrass
Sec: 7 Temporal Databases -7 -
RTS

Run-time Evaluator, cont.

• Temporal algebraic operators must be


implemented as extensions of existing
operators.
◆ Stage 1: Convert each into an expression
of conventional algebraic operators
◆ Stage 2: Provide specific
implementations of each

• Extensions to increase performance


◆ Consider non-1NF representations
(e.g., attribute timestamping) to reduce
redundancy
◆ Consider storage structures and access
methods optimized to temporal data,
e.g., temporal indexes

-----Zaniolo--Ceri--Faloutsos--Snodgrass--Subrahmanian--Zicari--All Rights Reserved----


Advanced Database Systems Morgan Kaufmann
Copyright © 1995-7 Christian S. Jensen and Richard T. Snodgrass
Sec: 7 Temporal Databases -8 -
RTS

Temporal Algebras

• Perhaps 15 have been proposed, over


as many years
• Closely tied to particular temporal
data models
• For snapshot reducible queries, a
simple algebra suffices.
• Difficult operators:
◆ temporal join
◆ coalescing
◆ aggregates
◆ temporal indexes

-----Zaniolo--Ceri--Faloutsos--Snodgrass--Subrahmanian--Zicari--All Rights Reserved----


Advanced Database Systems Morgan Kaufmann
Copyright © 1995-7 Christian S. Jensen and Richard T. Snodgrass
Sec: 7 Temporal Databases -9 -
RTS

Operator Implementation:
Temporal Join

• Conventional Join
◆ Nested loop
◆ Sort-merge
◆ Hash join
◆ Index Join

• Temporal Nested Loop Join


◆ Additional predicate: times overlap
◆ Can use same code,
¡ 2 for same
performance: O n

• Index Join
◆ Use a temporal index

-----Zaniolo--Ceri--Faloutsos--Snodgrass--Subrahmanian--Zicari--All Rights Reserved----


Advanced Database Systems Morgan Kaufmann
Copyright © 1995-7 Christian S. Jensen and Richard T. Snodgrass
Sec: 7 Temporal Databases - 10 -
RTS

Temporal Sort-Merge Join

• Problem: what to sort on


• Equi-join attribute
◆ Can have many versions with identical
join attribute value

• Start time
◆ Right-hand tuples with later start times
can overlap left-hand tuples.

• End time
◆ Same problem here

-----Zaniolo--Ceri--Faloutsos--Snodgrass--Subrahmanian--Zicari--All Rights Reserved----


Advanced Database Systems Morgan Kaufmann
Copyright © 1995-7 Christian S. Jensen and Richard T. Snodgrass
Sec: 7 Temporal Databases - 11 -
RTS

Temporal Sort-Merge Join, cont.

• Sort on composite sort key: join


attribute(s), start time, end time

• Retain tuples in buffer cache until end


time of tuple precedes start time of
current tuple

• May require flushing cache to disk

-----Zaniolo--Ceri--Faloutsos--Snodgrass--Subrahmanian--Zicari--All Rights Reserved----


Advanced Database Systems Morgan Kaufmann
Copyright © 1995-7 Christian S. Jensen and Richard T. Snodgrass
Sec: 7 Temporal Databases - 12 -
RTS

Temporal Hash Join

• Hash on equi-join attribute


◆ Can have many versions, with identical
value
◆ Sometimes hashing function is
inappropriate
◆ Large buckets

• Hash only on time


◆ Appropriate hash function is difficult to
predict

-----Zaniolo--Ceri--Faloutsos--Snodgrass--Subrahmanian--Zicari--All Rights Reserved----


Advanced Database Systems Morgan Kaufmann
Copyright © 1995-7 Christian S. Jensen and Richard T. Snodgrass
Sec: 7 Temporal Databases - 13 -
RTS

Temporal Hash Join, cont.

• Adaptive hash
◆ Hash first on join attribute
◆ For those buckets that are too large,
rehash on time
◆ Use sampling to determine appropriate
time hash function

• Performance is better than either


nested loop or sort-merge
◆ Usually not quadratic
◆ Avoids "hiccups"

-----Zaniolo--Ceri--Faloutsos--Snodgrass--Subrahmanian--Zicari--All Rights Reserved----


Advanced Database Systems Morgan Kaufmann
Copyright © 1995-7 Christian S. Jensen and Richard T. Snodgrass
Sec: 7 Temporal Databases - 14 -
RTS

Coalescing

• Bring value-equivalent tuples together,


compute temporal element

• For period-stamped tuples, repartition


into maximal periods

• Similar to a self-join
◆ For each tuple, find the tuples that are
value-equivalent
◆ Thus, every explicit attribute is a join
attribute

-----Zaniolo--Ceri--Faloutsos--Snodgrass--Subrahmanian--Zicari--All Rights Reserved----


Advanced Database Systems Morgan Kaufmann
Copyright © 1995-7 Christian S. Jensen and Richard T. Snodgrass
Sec: 7 Temporal Databases - 15 -
RTS

Coalescing, cont.

• Nested loop coalescing


◆ Will have poor performance for tables of
any size

• Sort-merge coalescing
◆ Sort on all attributes, then start time, then
stop time

• Hash join coalescing


◆ Again, appears to have superior
performance

-----Zaniolo--Ceri--Faloutsos--Snodgrass--Subrahmanian--Zicari--All Rights Reserved----


Advanced Database Systems Morgan Kaufmann
Copyright © 1995-7 Christian S. Jensen and Richard T. Snodgrass
Sec: 7 Temporal Databases - 16 -
RTS

Temporal Indexing

• Active area of research over the last


decade.

• About two dozen temporal index


structures have been proposed.

• Considerations
◆ Supports valid time or transaction time?
✱ For transaction time, supports
WORM devices?
✱ Can index itself be placed on a
WORM device?
◆ Space requirements
◆ Update performance

-----Zaniolo--Ceri--Faloutsos--Snodgrass--Subrahmanian--Zicari--All Rights Reserved----


Advanced Database Systems Morgan Kaufmann
Copyright © 1995-7 Christian S. Jensen and Richard T. Snodgrass
Sec: 7 Temporal Databases - 17 -
RTS

Temporal Indexing, cont.

• Considerations
◆ Query performance for different kinds of
temporal queries
◆ Clustering of data on disk
◆ Handling of long-lived and short-lived
tuples
◆ Robustness under changing data
distributions

-----Zaniolo--Ceri--Faloutsos--Snodgrass--Subrahmanian--Zicari--All Rights Reserved----


Advanced Database Systems Morgan Kaufmann
Copyright © 1995-7 Christian S. Jensen and Richard T. Snodgrass
Sec: 7 Temporal Databases - 18 -
RTS

Kinds of Temporal Queries

• Pure-timeslice query: given a time


period, find the values of all keys
during this period.
SELECT Name
FROM Prescription
WHERE VALID(Prescription) OVERLAPS PERIOD ’[1994]’

• Pure-key query: given a key range,


find the history of the keys in this
range.
SELECT Name
FROM Prescription
WHERE Name BETWEEN ’SA’ AND ’SZ’

-----Zaniolo--Ceri--Faloutsos--Snodgrass--Subrahmanian--Zicari--All Rights Reserved----


Advanced Database Systems Morgan Kaufmann
Copyright © 1995-7 Christian S. Jensen and Richard T. Snodgrass
Sec: 7 Temporal Databases - 19 -
RTS

Kinds of Temporal Queries, cont.

• Range-timeslice query: given a key


range and a time period P, find the
values of the keys in the given range
during P.

SELECT Name
FROM Prescription
WHERE Name BETWEEN ’SA’ AND ’SZ’
AND VALID(Prescription) OVERLAPS PERIOD ’[1994]’

-----Zaniolo--Ceri--Faloutsos--Snodgrass--Subrahmanian--Zicari--All Rights Reserved----


Advanced Database Systems Morgan Kaufmann
Copyright © 1995-7 Christian S. Jensen and Richard T. Snodgrass
Sec: 7 Temporal Databases - 20 -
RTS

Classification of Temporal
Indexes

• Using B-Trees directly


• Extended B-Trees
◆ Valid-time indexes
◆ Transaction-time indexes

• Using multi-dimensional indexes


directly

• Using spatial indexes directly


• Extended spatial indexes

-----Zaniolo--Ceri--Faloutsos--Snodgrass--Subrahmanian--Zicari--All Rights Reserved----


Advanced Database Systems Morgan Kaufmann
Copyright © 1995-7 Christian S. Jensen and Richard T. Snodgrass
Sec: 7 Temporal Databases - 21 -
RTS

Summary

• The architecture of a conventional


DBMS is appropriate for a temporal
DBMS.
◆ Most modules must be modified, but
changes are not large.
◆ Additional modules may be needed.
✱ Archival data (WORM) manager
✱ Vacuuming daemon

• Many temporal algebras have been


defined.
◆ Simplicity and preservation of
tautologies are critical.

-----Zaniolo--Ceri--Faloutsos--Snodgrass--Subrahmanian--Zicari--All Rights Reserved----


Advanced Database Systems Morgan Kaufmann
Copyright © 1995-7 Christian S. Jensen and Richard T. Snodgrass
Sec: 7 Temporal Databases - 22 -
RTS

Summary, cont.

• Many implementation techniques


have been proposed for temporal joins,
coalescing, aggregation, and indexing.
◆ Challenge is choosing appropriate
technique

-----Zaniolo--Ceri--Faloutsos--Snodgrass--Subrahmanian--Zicari--All Rights Reserved----


Advanced Database Systems Morgan Kaufmann
Copyright © 1995-7 Christian S. Jensen and Richard T. Snodgrass
Part 2 Temporal Databases -1 -
RTS

7. Temporal Databases Summary

• Part Summary

• Stages of Research in Temporal


Databases

• The Future

-----Zaniolo--Ceri--Faloutsos--Snodgrass--Subrahmanian--Zicari--All Rights Reserved----


Advanced Database Systems Morgan Kaufmann
Copyright © 1995-7 Christian S. Jensen and Richard T. Snodgrass
Part 2 Temporal Databases -2 -
RTS

Part Summary

1. Introduction to Temporal
Databases
◆ Most applications are temporal.
◆ SQL does not provide adequate support
for such applications.
◆ Temporal query languages do provide
such support.
2. Time Ontology
◆ Different notions of time exist.
◆ Time data types
◆ Associating times with facts

-----Zaniolo--Ceri--Faloutsos--Snodgrass--Subrahmanian--Zicari--All Rights Reserved----


Advanced Database Systems Morgan Kaufmann
Copyright © 1995-7 Christian S. Jensen and Richard T. Snodgrass
Part 2 Temporal Databases -3 -
RTS

Part Summary, cont.

3. Data Model Concepts


◆ Overview of how time is added facts in
data models
✱ Valid time and transaction time
✱ Attribute versus tuple timestamping
• 4. TSQL2 Data Model
◆ Bitemporal Conceptual Data Model

5. TSQL2
◆ Covered a wide range of language
constructs

-----Zaniolo--Ceri--Faloutsos--Snodgrass--Subrahmanian--Zicari--All Rights Reserved----


Advanced Database Systems Morgan Kaufmann
Copyright © 1995-7 Christian S. Jensen and Richard T. Snodgrass
Part 2 Temporal Databases -4 -
RTS

Part Summary, cont.

6. Temporal DBMS Implementation


◆ Explored extending the conventional
architecture
◆ Considered operator implementation
◆ Temporal indexing

-----Zaniolo--Ceri--Faloutsos--Snodgrass--Subrahmanian--Zicari--All Rights Reserved----


Advanced Database Systems Morgan Kaufmann
Copyright © 1995-7 Christian S. Jensen and Richard T. Snodgrass
Part 2 Temporal Databases -5 -
RTS

Stages

• Concept Development: 1956 to 1985


◆ Multiple kinds of time
◆ Conceptual modeling
• Temporal Query Languages: 1978 to
1994
◆ Relational: 1978 to 1990
◆ Object-Oriented: 1990 to 1994
• Implementation: 1988 to present
◆ Storage structures
◆ Operator algorithms
◆ Temporal indexes
• Consolidation: 1993 to present
◆ Terminology
◆ TSQL2
-----Zaniolo--Ceri--Faloutsos--Snodgrass--Subrahmanian--Zicari--All Rights Reserved----
Advanced Database Systems Morgan Kaufmann
Copyright © 1995-7 Christian S. Jensen and Richard T. Snodgrass
Part 2 Temporal Databases -6 -
RTS

The Future

• Temporal database design methodology


• Commercial systems, which will
encourage work in
◆ Refined temporal DBMS architecture
◆ More sophisticated implementation
techniques
◆ Temporal query optimization
✱ Temporal 4GLs and design
environments and middleware and ...

• More language development


• Consolidation in temporal object-
oriented databases
• Spatiotemporal databases, scientific
databases, data mining, ...
-----Zaniolo--Ceri--Faloutsos--Snodgrass--Subrahmanian--Zicari--All Rights Reserved----
Advanced Database Systems Morgan Kaufmann
Copyright © 1995-7 Christian S. Jensen and Richard T. Snodgrass
Temporal Databases: A Bibliography
Over 1000 entries may be found in time.bib and spacetime.bib, which may be obtained via anonymous FTP
from FTP.cs.arizona.edu.
Bibliographies
Al-Taha, K.K., Snodgrass, R.T., and Soo, M.D., \Bibliography on Spatiotemporal Databases" International Jour-
nal of Geographical Information Systems 8, pp. 195{203, January-February 1994.
Bolour, A., Anderson, T.L., Dekeyser, L.J., and Wong, H.K.T., \The role of time in information processing: A
survey," SigArt Newsletter 80, pp. 28{48, April 1982.
Kline, N., \An Update of the Temporal Database Bibliography," ACM SIGMOD Record 22, 4, pp. 66{80, De-
cember 1993.
McKenzie, M., \Bibliography: Temporal Databases," ACM SIGMOD Record 15, 4, pp. 40{52, December 1986.
Roddick, J.F., \Schema Evolution in Database Systems | An Annotated Bibliography," ACM SIGMOD Record
21, 4, pp. 35{40, December1992.
Soo, M.D., \Bibliography on Temporal Databases," ACM SIGMOD Record 20, 1, pp. 14{23, March 1991.
Stam, R., and Snodgrass, R.T., \A Bibliography on Temporal Databases," IEEE Database Engineering 7, 4,
pp. 231{239, December 1988.

Books
Snodgrass, R.T., editor, The TSQL2 Temporal Query Language, Kluwer Academic Publishers, 1995, 674+xxiv
pages.
Tansel, A., Cli ord, J., Gadia, S., Jajodia, S., Segev, A., and Snodgrass, R.T. (eds.). Temporal Databases: The-
ory, Design, and Implementation. Database Systems and Applications Series. Benjamin/Cummings, Redwood
City, CA, 1994.

Surveys
Chomicki, J., \Temporal query languages: A survey," in Ohlbach, H. J. Gabbay, D. M., editor, Proceedings of the
First International Conference on Temporal Logic. Lecture Notes in Arti cial Intelligence 827, Springer-Verlag,
pp. 506{534, July 1994.
G. O zsoyoglu, and R.T. Snodgrass, \Temporal and Real-Time Databases: A Survey," IEEE Transactions on
Knowledge and Data Engineering, Vol. 7, No. 4, August, 1995, 48 pages.
Snodgrass, R.T., \Temporal Databases," Theories and Methods of Spatio-Temporal Reasoning in Geographic
Space, A. U. Frank, I. Campari, and U. Formentini (eds.), Springer-Verlag Lecture Notes in Computer Science

1
639, pp. 22{64, September 1992.
Snodgrass, R.T., \Temporal Object-Oriented Databases: A Critical Comparison," chapter 19 in Modern Database
Systems: The Object Model, Interoperability and Beyond, W. Kim, editor, Addison-Wesley/ACM Press, 1995,
pp. 386{408.

Selected Articles
Ahn, I., and Snodgrass, R.T., \Performance Evaluation of a Temporal Database Management System," in C. Zan-
iolo, editor, Proceedings of the ACM International Conference on Management of Data, pp. 96{107, May 1986.
Ahn, I., and Snodgrass, R.T., \Partitioned Storage for Temporal Databases," Information Systems 13, 4, pp. 369{
391, 1988.
Ahn, I., and Snodgrass, R.T., \Performance Analysis of Temporal Queries," Information Sciences 49, pp. 103{
146, 1989.
Ait-Braham, A., Theodoulidis, B., and Karvelis, G., \Conceptual Modelling and Manipulation of Temporal
Databases," in Proceedings of the Entity-Relationship Conference, 1994.
Andany, J., Leonard, M., and Palisser, C., \Management of schema evolution in databases," in Proceedings of the
Conference on Very Large Databases, Barcelona, Spain, pp. 161{170, September 1991.
Ariav, G., \A temporally oriented data model," ACM Transactions on Database Systems 11, 4, pp. 499{527,
December, 1986.
Barbic, F., and Pernici, B., \Time modeling in oce information systems," In S. Navathe, editor, Proceedings of
the ACM International Conference on Management of Data, Austin, TX, pp. 51{62, May 1985.
Bassiouni, M.A., and Llewellyn, M.J., \A Relational-Calculus Query Language for Historical Databases," Journal
of Computer Languages 17, 3, pp. 185{197, 1992.
Becker, B., Gschwind, S., Ohler, T., Seeger, B., and Widmayer, P., \On Optimal Multiversion Access Structures,"
in Proceedings of the Symposium on Large Spatial Databases, Singapore, pp. 123{141, 1993.
Beech, D., and Mahbod, B., \Generalized version control in an object-oriented database," in Proceedings of the
International Conference on Very Large Databases, pp. 14-22, February 1988.
Ben-Zvi, J., The Time Relational Model. Ph.D. thesis, Computer Science Department, UCLA, 1982.
Bhargava, G., and Gadia, S.K., \Relational database systems with zero information loss," IEEE Transactions on
Knowledge and Data Engineering 5, 7, pp. 76{87, February 1993.
Bohlen, M., and Marti, R., \Handling Temporal Knowledge in a Deductive Database System," Datenbanksysteme
in Buro, Technik und Wisenschaft, Springer-Verlag, 1993.
Cardenas, A., Ieong, I., Taira, R., Barker, R., and Breant, C., \The Knowledge-Based Object-Oriented PIC-
QUERY+ Language," IEEE Transactions on Knowledge and Data Engineering 5, 4, pp. 644{657, August 1993.
Caruso, M., and Sciore, E., \Meta-functions and contexts in an object-oriented database language," In Proceed-
ings of the ACM International Conference on Management of Data, Chicago, IL, pp. 56{65, June 1988.

2
Chakravarthy, S. and Kim, S.-K., \Resolution of Time Concepts in Temporal Databases," Information Sciences
80, 1{2, pp. 91{125, September 1994.
Chomicki, J., and Imelinski, T., \Relational speci cations of in nite query answers," in Proceedings of the ACM
International Conference on Management of Data, pp. 174{183, May 1989.
Chou, H.T., and Kim, W., \A unifying framework for version control in a CAD environment," in Proceedings of
the International Conference on Very Large Databases, pp. 336{344, 1986.
Chu, W. W., Ieong, I. T., Taira, R. K., Breant, C. M., \A Temporal Evolutionary Object-Oriented Data Model
and Its Query Language for Medical Image Management," in Proceedings of the Very Large Database Conference,
August 1992.
Cli ord, J., and Croker, A., \The Historical Relational Data Model (HRDM) and Algebra Based on Lifespans,"
in Proceedings of the International Conference on Data Engineering, pp. 528{537, Los Angeles, CA, February 1987.
Cli ord, J., Croker, A., and Tuzhilin, A., \On completeness of historical relational query languages," ACM Trans-
actions on Database Systems 19, 1, pp. 64{116, March 1994.
Cli ord, J., and Tansel, A.U., \On an algebra for historical relational databases: Two views," in S. Navathe,
editor, Proceedings of the ACM International Conference on Management of Data, pp. 247{265, Austin, TX,
May 1985.
Cli ord, J., and Warren, D.S., \Formal semantics for time in databases," ACM Transactions on Database Systems
8, 2, pp. 214{254, June 1983.
Dadam, P., Lum, V., and Werner, H.-D., \Integration of time versions into a relational database system," in
U. Dayal, G. Schlageter and L.H. Seng, editors, Proceedings of the Conference on Very Large Databases, pp. 509{
522, Singapore, August 1984.
Date, C.J., \A proposal for adding date and time support to SQL," ACM SIGMOD Record 17, 2, pp. 53{76, June
1988.
Dayal, U., and Smith, J.M., PROBE: A Knowledge-Oriented Database Management System. Springer-Verlag,
1986.
Dayal, U., and Wuu, G.T.J., \A uniform approach to processing temporal queries," in Proceedings of the Confer-
ence on Very Large Databases, Vancouver, Canada, August 1992.
DeAntonellis, V., Degli, A., Mauri, G., and Zonta, B., \Extending the entity-relationship approach to take into
account historical aspects of systems," in P. Chen, editor, Proceedings of the International Conference on the E-R
Approach to Systems Analysis and Design. North Holland, 1979.
Dreyer, W., Dittrich, A.K., Schmidt, D., \An Object-Oriented Data Model for a Time Series Management Sys-
tem," in Proceedings of the International Working Conference on Scienti c and Statistical Database Management,
J.C. French and H. Hinterberger, editors, Charlottesville, VA, pp. 185{95, September, 1994.
Dutta, S., \Generalized events in temporal databases," in Proceedings of the International Conference on Data
Engineering, pp. 118{126, Los Angeles, CA, February 1989.
Dyreson, C.E., and Snodgrass, R.T., \Valid-time Indeterminacy," in Proceedings of the International Conference
on Data Engineering, pp. 335{343, Vienna, Austria, April 1993.

3
Elmasri, R., and Wuu, G.T.J., \A temporal model and query language for ER databases," in Proceedings of the
International Conference on Data Engineering, pp. 76{83, February 1990.
Elmasri, R., Wuu, G.T.J.,, and Kim, Y., \The Time Index - An Access Structure for Temporal Data," in Pro-
ceedings of the Conference on Very Large Databases, Brisbane, Australia, August 1990.
Elmasri, R., Kim, Y.-J.,, and Wuu, G.T.J., \Ecient implementation techniques for the time index," In Proceed-
ings of the International Conference on Data Engineering, pp. 102{111, 1991.
Elmasri, R., Jaseemuddin, M., and Kouramajian, V., \Partitioning of time index for optical disks," in F. Golshani,
editor, Proceedings of the International Conference on Data Engineering, pp. 574{583, Phoenix, AZ, February
1992.
Emerson, E.A., \Temporal and Modal Logic," in J. van Leeuwen, editor, Handbook of Theoretical Computer
Science, pp. 997{1067, Elsevier Science Publishers, B.V., 1990.
Faloutsos, C., Ranganathan, M., and Manolopoulos, Y., \Fast Subsequence Matching in Time-Series Databases,"
in Proceedings of the ACM SIGMOD International Conference on Management of Data, R.T. Snodgrass and
M. Winslett, editors, pp. 419{429, Minneapolis, MN, May, 1994.
Frank, A.U., \Qualitative Temporal Reasoning is GIS-Ordered Time Scales," Technical Report, Dept. for Geo-
Information, Technische Universitat Wien, 1994.
Gadia, S.K., \Toward a multihomogeneous model for a temporal database," in Proceedings of the International
Conference on Data Engineering, pp. 390{397, Los Angeles, CA, February 1986.
Gadia, S.K., \A homogeneous relational model and query languages for temporal databases," ACM Transactions
on Database Systems 13, 4, pp. 418{448, December 1988.
Gadia, S.K., Nair, S., and Poon, Y.-C., \Incomplete information in relational temporal databases," in Proceedings
of the Conference on Very Large Databases, Vancouver, Canada, August 1992.
Gadia, S.K., and Yeung, C.S., \A generalized model for a relational temporal database," in Proceedings of the
ACM International Conference on Management of Data, pp. 251{259, Chicago, IL, June 1988.

Goralwalla, I., and Ozsu, M.T., \Temporal Extensions to a Uniform Behavioral Object Model," in Proceedings
of the International Conference on Entity-Relationship Approach, Dallas, TX, June 1993.
Gunadhi, H., and Segev, A., \A Framework for Query Optimization in Temporal Databases", in Proceedings of the
International Conference on Statistical and Scienti c Database Management Systems, volume 420, pp. 131{147,
Springer Verlag, April 1990.
Gunadhi, H., and Segev, A., \Query processing algorithms for temporal intersection joins," in Proceedings of the
International Conference on Data Engineering, Kobe, Japan, 1991.
Gunadhi, H., and Segev, A., \Ecient indexing methods for temporal relations," IEEE Transactions on Knowl-
edge and Data Engineering 5, 3, pp. 496{509, June 1993.
Hammer, M., and McLeod, D., \Database Description with SDM: A Semantic Database Model," ACM Transac-
tions on Database Systems 6, 3, pp. 351{386, September 1981.
Hawking, S., A Brief History of Time. Bantam Books, New York, 1988.

4
Hsu, S., and Snodgrass, R.T., \Optimal Block Size for Set-valued Attributes," Information Processing Letters 45,
3, pp. 153{158, March 1993.
Jensen, C.S., Mark, L., and Roussopoulos, N., \Incremental implementation model for relational databases with
transaction time," IEEE Transactions on Knowledge and Data Engineering 3, 4, pp. 461{473, December 1991.
Jensen, C.S., and Mark, L., \Queries on change in an extended relational model," IEEE Transactions on Knowl-
edge and Data Engineering 4, 2 April 1992, pp. 192{200.
Jensen, C.S., Mark, L., Roussopoulos, N., and Sellis, T., \Using di erential techniques to eciently support
transaction time," The VLDB Journal 2, 1, pp. 75{111, January 1993.
Jensen, C.S., Cli ord, J., Elmasri, R., Gadia, S.K., Hayes, P., and Jajodia, S. (eds.), \A consensus glossary of
temporal database concepts," Technical Report R 93-2035, Department of Mathematics and Computer Science,
Institute for Electronic Systems, Denmark, November 1993.
Jensen, C.S., and Snodgrass, R.T., \Temporal Specialization and Generalization," IEEE Transactions on Knowl-
edge and Data Engineering 6, 6, pp. 954{974, December 1994.
Jensen, C. S., Soo, M. D., and Snodgrass, R.T., \Unifying Temporal Models via a Conceptual Model," Informa-
tion Systems 19, 7, pp. 513{547, December 1994.
Jones, S., Mason, P, and Stamper, R., \Legol 2.0: A relational speci cation language for complex rules," Infor-
mation Systems 4, 4, pp. 293{305, November 1979.
Kafer, W., \History and Version Management of Complex Objects (in German)" , Ph.D. thesis, Fachbereich
Informatik, University Kaiserslautern, 1992.
Kafer, W., and Schoning, H., \Mapping a Version Model to a Complex-Object Data Model" , in Proceedings of
International Conference on Data Engineering, pp. 348{357, 1992.
Kafer, W., and Schoning, H., \Realizing a Temporal Complex-Object Data Model", in Proceedings of the ACM
International Conference on Management of Data, pp. 266{275, 1992.
Kahn, K., and Gorry, G.A., \Mechanizing temporal knowledge," Arti cial Intelligence, pp. 87{108, 1977.
Kim, W., and Chou, H.T., \Versions of Schema in OODB," in Proceedings of the International Conference on
Very Large Databases, pp. 148{159, Long Beach, CA, 1988.
Kim, W., Garza, J.F., Ballou, N., and Woelk, D., \Architecture of the Orion next-generation database system,"
IEEE Transactions on Knowledge and Data Engineering 2, 1, pp. 109{124, March 1990.
Kim, S.-K. and Chakravarthy, S., \Temporal Databases with Two-Dimensional Time: Modeling and Implemen-
tation of Multihistory," Information Sciences 80, 1{2, pp. 43{89, September 1994.
Kimball, K.A., \The DATA System," Master's thesis, University of Pennsylvania, 1978.
Klopprogge, M.R., \TERM: An Approach to Include the Time Dimension in the Entity-Relationship Model," in
Proceedings of the International Conference on the Entity Relationship Approach, pp. 477{512, Washington, DC,
October 1981.
Kolovson, C., and Stonebraker, M., \Indexing techniques for historical databases," in Proceedings of the Interna-
tional Conference on Data Engineering, pp. 127{137, Los Angeles, CA, February 1989.

5
Kolovson, C., and Stonebraker, M., \Segment Indexes: Dynamic Indexing Techniques for Multi-Dimensional In-
terval Data," In J. Cli ord and R. King, editors, Proceedings of ACM SIGMOD Conference on Management of
Data, pp. 138{147, June 1991.
Koubarakis, M., \Representation and querying in temporal databases: the power of temporal constraints," in
Proceedings of the International Conference on Data Engineering, pp. 327{334, Vienna, Austria, April 1993.
Ladkin, P., The Logic of Time Representation. Ph.D. thesis, University of California, Berkeley, November 1987.
Lanka, S., and E. Mays, \Fully Persistent B+ Trees," in Proceedings of the ACM SIGMOD International Con-
ference on Management of Data, pp. 426{435, 1991.
Landau, G.M., Schmidt, J.P., and Tsotras, V.J., \On Historical Queries for Multiple Lines of Evolution," VLDB
Journal, to appear, 1995.
Lee, R.M., Coelho, H., and Cotta, J.C., \Temporal inferencing on administrative databases," Information Sys-
tems 10, 2, pp. 197{206, 1985.
Leung T.Y., and Muntz, R., \Query processing for temporal databases," in Proceedings of the International Con-
ference on Data Engineering, Los Angeles, California, February 1990.
Leung, T.Y., and Muntz, R., \Generalized data stream indexing and temporal query processing," in Proceedings
of the Second International Workshop on Research Issues in Data Engineering: Transaction and Query Process-
ing, February 1992.
Lomet, D., and Salzberg, B., \Access methods for multiversion data," in Proceedings of the ACM International
Conference on Management of Data, pp. 315{324, June 1989.
Lomet, D., and Salzberg, B., \The performance of a multiversion access method," in Proceedings of the ACM
International Conference on Management of Data, pp. 353{363, Atlantic City, May 1990.
Lomet, D., \Grow and post index trees: Role, techniques and future potential," in Proc. of the Second Symposium
on Large Spatial Databases, 1991.
Lorentzos, N.A., and Johnson, R.G., \Extending relational algebra to manipulate temporal data," Information
Systems 13, 3, pp. 289{296, 1988.
Lu, H., Ooi, B.-C., and Tan, K.-L., \On Spatially Partitioned Temporal Join," in Proceedings of the International
Conference on Very Large Databases, Santiago, Chile, pp. 546{557, September 1994.
Lum, V., Dadam, P., Erbe, R., Guenauer, J., Pistor, P., Walch, G., Werner, H., and Wood ll, J., \Designing
DBMS Support for the Temporal Dimension," in B. Yormark, editor, Proceedings of the ACM International Con-
ference on Management of Data, pp. 115{130, Boston, MA, June 1984.
Lyngbk, P., \OSQL: A Language for Object Databases," Technical Report HPL-DTD-91-4, Hewlett-Packard
Laboratories, Palo Alto, CA, January 1991.
Manolopoulos, Y, and Kapetanakis, G., \Overlapping B+ Trees for Temporal Data," in Proceedings of the JCIT
Conference, Jerusalen, Israel, pp. 491{498, October 1990.
McKenzie, E., and Snodgrass, R.T., \Schema Evolution and the Relational Algebra," Information Systems 15,
2, pp. 207{232, June 1990.

6
McKenzie, E., and Snodgrass, R., \An Evaluation of Relational Algebras Incorporating the Time Dimension in
Databases," ACM Computing Surveys 23, 4, pp. 501{543, December 1991.
McKenzie, E., and Snodgrass, R.T., \Supporting Valid Time in an Historical Relational Algebra: Proofs and
Extensions," Technical Report TR-91-15, Department of Computer Science, University of Arizona, Tucson, AZ,
August 1991.
Mylopoulos, J., Borgida, A., Jarke, M., and Koubarakis, M., \Telos: Representing Knowledge about Information
Systems," ACM Transactions on Oce Information Systems 8, 4, pp. 325{362, October 1990.
Navathe, S.B. and Ahmed, R., \A temporal relational model and a query language," Information Sciences 49,
pp. 147{175, 1989.
Overmyer, R., and Stonebraker, M., \Implementation of a time expert in a database system," ACM SIGMOD
Record 12, 3, pp. 51{59, April 1982.
O zsu, M.T., Peters, R., Szafron, D., Irani, B., Lipka, A., and Mu~noz, \TIGUKAT: A Uniform Behavioral Ob-
jectbase Management System," VLDB Journal, (1995) (to appear).
Plou e, W., Kim, W., Lorie, R., and McNabb, D., \Versions in an engineering database system," IBM Research
Report RJ4085, San Jose, CA, October 1983.
Rescher, N.C., and Urquhart, A., Temporal Logic, Springer-Verlag, 1971.
Rose, E., and Segev, A., \TOODM | A Temporal Object-oriented Data Model with Temporal Constraints," In
Proceedings of the International Conference on the Entity Relationship Approach, October 1991.
Rose, E., and Segev, A., \TOOA: A Temporal Object-oriented Algebra," In Proceedings of the European Confer-
ence on Object-Oriented Programming, July 1993.
Rose, E., and Segev, A., \TOOSQL { a temporal object-oriented query language," In Proceedings of the Interna-
tional Conference on the Entity-Relationship Approach, Dallas, TX, 1993.
Sadeghi, R., A Database Query Language for Operations on Historical Data. Ph.D. thesis, Dundee College of
Technology, Dundee, Scotland, December 1987.
Sadeghi, R., Samson, W.B., and Deen, S.M., \HQL | A Historical Query Language," Technical report, Dundee
College of Technology, Dundee, Scotland, September 1987.
Slazberg, B., and V.J. Tsotras, \A Comparison of Access Methods for Time Evolving Data," Technical Report
CATT-TR-94-81, Polytechnic University, 1994.
Sarda, N., \Algebra and query language for a historical data model," The Computer Journal 33, 1, pp. 11{18,
February 1990.
Sarda, N., \Extensions to SQL for historical databases," IEEE Transactions on Knowledge and Data Engineering
2, 2, pp. 220{230, June 1990.
Sciore, E., \Using annotations to support multiple kinds of versioning in an object-oriented database system,"
ACM Transactions on Database Systems 16, 3, pp. 417{438, September 1991.

7
Sciore, E., \Versioning and con guration management in an object-oriented data model," VLDB Journal (to
appear), 1994.
Segev, A., Himawan, G., Chandra, R., and Shanthikumar, J., \Selectivity estimation of temporal data manipu-
lations," Information Sciences 74, 1-2, October 1993.
Segev, A., and Shoshani, A., \Logical modeling of temporal data," In U. Dayal and I. Traiger, editors, Proceedings
of the ACM SIGMOD International Conference on Management of Data, pp. 454{466, San Francisco, CA, May
1987.
Segev, A., and Chandra, R., \A Data Model for Time-Series Analysis," Advanced Database Systems, N.R. Adam
and B.K. Bhargava, editors, Springer-Verlag, 1993, pp. 191{212.
Seshadri, P., Livny, M., and Ramakrishnan, R., \Sequence Query Processing," in Proceedings of the ACM SIG-
MOD International Conference on Management of Data, R.T. Snodgrass and M. Winslett, editors, pp. 430{441,
Minneapolis, MN, May, 1994.
Shahar, Y., Tu, S.W., Musen, M.A., \Knowledge Acquisition for Temporal-Abstraction Mechanisms," Knowedge
Acquisition 4, 2, pp. 217-236, June 1992.
Shahar, Y., Musen, M.A., \RESUME: A Temporal-Abstraction System for Patient Monitoring," Computers and
Biomedical Research 26, 3, pp. 255{273, June 1993.
Snodgrass, R.T., and Ahn, I., \Temporal Databases," IEEE Computer 19, 9, pp. 35{42, September 1986.
Snodgrass, R.T., \The Temporal Query Language TQuel," ACM Transactions on Database Systems 12, 2,
pp. 247{298, June 1987.
Snodgrass, R.T., Ahn, I., Ariav, G., Batory, D.S., Cli ord, J., Dyreson, C.E., Elmasri, R., Grandi, F., Jensen,
C.S., Kafer, W., Kline, N., Kulkanri, K., Leung, C.Y.T., Lorentzos, N., Roddick, J.F., Segev, A., Soo, M.D., and
Sripada, S.M., \TSQL2 Language Speci cation," ACM SIGMOD Record 23, 1, pp. 65{86, March 1994.
Soo, M.D., Snodgrass, R.T., and Jensen, C.S., \Ecient Evaluation of the Valid-time Natural Join," in Proceed-
ings of the International Conference on Data Engineering, pp. 282{292, February 1994.
Sripada, S., \A logical framework for temporal deductive databases," In Proceedings of the International Confer-
ence on Very Large Databases, pp. 171{182, Los Angeles, CA, 1988.
Stonebraker, M., Rowe, L., and Hirohama, M., \The Implementation of Postgres," IEEE Transactions on Knowl-
edge and Data Engineering 2, 1, pp. 125{142, March 1990.
Su, S.Y.W., and Chen, H.M., \A Temporal Knowledge Representation Model OSAM*/T and Its Query Language
OQL/T," In Proceedings of the International Conference on Very Large Databases, 1991.
Tansel, A.U., \Adding time dimension to relational model and extending relational algebra," Information Systems
11, 4, pp. 343{355, 1986.

Tansel, A.U., Arkun, M.E., and Ozsoyo glu, G., \Time-By-Example Query Language for Historical Databases,"
IEEE Transactions on Software Engineering 15 4, pp. 464{478, April 1989.
Tansel, A.U., \A Historical Query Language," Information Sciences 53, pp. 101{133, 1991.

8
Thompson, P.A., A Temporal Data Model Based on Accounting Principles. Ph.D. thesis, Department of Com-
puter Science, University of Calgary, Calgary, Alberta, Canada, March 1991.
Tsotras, V., Gopinath, B., and Hart, G., \Ecient Management of Time-Evolving Databases," IEEE Transac-
tions on Knowledge and Data Engineering (to appear), 1995.
Tsotras, V., and Kangelaris, N., \The Snapshot Index, an I/O-Optimal Access Method for Timeslice Queries,"
Information Systems (to appear), 1995.
Urban, S.D., and Delcambre, L.M.L., \An analysis of the structural, dynamic, and temporal aspects of semantic
data models," in Proceedings of the International Conference on Data Engineering, volume IEEE Computer Soci-
ety Order Number 655, pp. 382{389, Los Angeles, CA, February 1986. IEEE Computer Society, IEEE Computer
Society Press.
Van Benthem, J.F.K.A., The Logic of Time: A Model-Theoretic Investigation into the Varieties of Temporal
Ontology and Temporal Discourse. Reidel, Hingham, MA, 1982.
Wang, X., Jajodia, S., and Subrahamanian, V., \Temporal Modules: An Approach Toward Temporal Databases,"
in Proceedings of the ACM SIGMOD International Conference on Management of Data, R.T. Snodgrass and
M. Winslett, editors, Minneapolis, MN, pp. 227{236, May 1994.
Wiederhold, G., Fries, J.F., and Weyl, S., \Structured organization of clinical data bases," in Proceedings of the
National Computing Conference, pp. 479{485, 1975.
Wiederhold, G., Jajodia, S., and Litwin, W., \Dealing with granularity of time in temporal databases," in Proc.
3rd Nordic Conference on Advanced Information Systems Engineering, Trondheim, Norway, May 1991.
Wilkinson, K., Lyngbk, P., and Hasan, W., \The IRIS Architecture and Implementation," IEEE Transactions
on Knowledge and Data Engineering 2, 1, pp. 63{75, March 1990.
Worboys, M.F., \Reasoning about GIS using temporal and dynamic logics," in Temporal GIS Workshop. Uni-
versity of Maine, October 1990.
Wuu, G.T.J., \SERQL: An ER Query Language Supporting Temporal Data Retrieval," in Proceedings of the 10th
International Phoenix Conference on Computers and Communications, pp. 272{279, March 1991.
Wuu, G.T.J., and Dayal, U., \A uniform model for temporal object-oriented databases," In Proceedings of the
International Conference on Data Engineering, pp. 584{593, Tempe, Arizona, February 1992.
Yau, C., and Chat, G. S. W., \TempSQL { A Language Interface to a Temporal Relational Model," Information
Sc. & Tech., pp. 44{60, October, 1991.

You might also like