Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Systems
A. Prasad Sistla, Ouri Wolfson
Electrical Engineering and Computer Science Department
University of Illinois
Chicago, Illinois 60680
1
in the sense that when a new database state is cre- algorithm can accommodate both notions.
ated as a result of an update, the algorithm only We also demonstrate that our rule formalism also
considers the changes in the new database state in enables the specication of temporal actions, i.e.,
order to determine if the condition is satised, in- composite actions built from atomic ones using tem-
stead of considering the whole database history. The poral operators. For example, the user can specify
evaluation algorithm is also an add-on component, that when a certain condition is satised, the sys-
executed on top of, and using the existing query pro- tem should execute the BUY-STOCK transaction
cessing system. every 10 minutes (in order to prevent driving up the
Temporal integrity constraints are temporal con- stock-price), as long as the stock-price remains be-
ditions that must be satised at every commit point low 50. Previously, such temporal actions required
of a transaction. We propose a new framework for extended transactions models ([9, 10, 13]) that must
processing temporal integrity constraints. Existing be controlled by an additional software system run-
methods for processing such constraints ([17, 38]) ning on top of the database management system.
translate them into a set of rules with nontemporal The temporal condition formalism also requires an
conditions. In contrast, we process integrity con- additional software system, the condition evaluator,
straints "from rst principles" so to speak. Our but this is the same system used for rule process-
rule conditions are temporal, thus we use the algo- ing, integrity constraint enforcement, and temporal
rithm that processes temporal conditions for both, actions. Furthermore, the specication of temporal
rule processing and integrity constraints processing. actions involving iteration and absolute and relative
We show that our proposed language and pro- timing properties (every 10 minutes) is not straight-
cessing algorithm can work with valid time as well forward in existing models of extended transactions.
as transaction time. The important distinction be- In summary, the contributions of this paper are as
tween the two notions of time was introduced in follows.
the context of temporal databases [31], and is criti- We introduce a temporal-logic based language
cal in rule and constraint processing, in the follow- and incremental processing algorithm. The lan-
ing sense. The database is usually a model of the guage can be used for temporal integrity con-
real-world and the time at which changes happen straints, and for rules that are simpler (only in-
in the real-world, namely the valid time, may pre- volve conditions and actions) and more powerful
cede the time at which these changes are posted in than existing rule languages. It also supports
the database, namely the transaction time. Further- temporal aggregates, and it is independent of
more, the temporal conditions may refer to the valid the underlying data model.
time rather than the transaction time. For example,
consider a transaction that updates the price of a We dene various semantics for rules and in-
stock, i.e., posts to the database the price of a stock tegrity constraints with respect to two notions
sale. The sale may have occurred ve minutes be- of time, valid time and transaction time. We
fore the change in the stock price is committed to show how to use the processing algorithm for
the database. It is easy to see that there are trig- the various semantics.
gers that will re with respect to the valid time but We show that the temporal conditions can be
will not re with respect to the transaction time, or used for the specication of temporal actions,
vice versa. For example, consider the temporal con- which are a form of extended transactions.
dition: "the stock price remains constant for seven
minutes". This condition may be satised with re- This paper is organized as follows. Section 2 de-
spect to the transaction time, but not with respect scribes the model that we use; section 3 introduces
to the valid time, and vice versa. temporal rule systems. Section 4 denes the ba-
We show that in the valid time model temporal sic Past Temporal Logic (PTL) without aggregates.
conditions in rules and integrity constraints can have Section 5 presents the processing algorithm for PTL.
dierent semantics. For example, we show that an Section 6 incorporates temporal aggregates in to
integrity constraint with respect to a database his- PTL and shows how they can be processed. Sec-
tory can be online satised but not oine satised, tion 7 shows how temporal and composite actions
and vice versa. Similarly, we show that execution of can be specied using our formalism. Section 8 de-
an action in a rule can be based on either tentative scribes the execution model. Section 9 shows how
or denite history, and our language and processing we can handle valid time model. Sections 10 and 11
contain comparison to other work and conclusions, along the history are strictly increasing.
respectively.
lar types, and returns a value. For example, + and satises f with respect to . More specically,
* are function symbols denoting addition and mul- if f is an event then it is satised by h if the
tiplication on the integer type. Similarly, ; are event f is in E . Otherwise, f is satised by h
i
binary relation symbols denoting arithmetic compar- if the database state S satises f.
i
ison operators. The functions symbols are also used If f is of the form f = f1 ^ f2 , or f = f1 _ f2 , or
to denote queries on databases. For example, con-
sider the following relational query, OVERPRICED, f = :f1 , then the satisfaction of f by h depends
that retrieves all stocks with a price above a certain on, respectively, the fact that database state S i
threshold from a relation called STOCK-FOR-SALE satises both f1 and f2 , or S does not satisfy
i
(the relation contains tuples consisting of a stock f1 , or S satises either f1 or f2 , with respect
i
(X).
tion.
We rst dene the syntax of terms in the logic. If f = Lasttime f1 , then f is sat-
Every variable and constant is a term. If f is a n-ary ised by h with respect to i history
function then f(t1 ; :::; t ) is a term where t1 ; :::; t ((S0 ; E0); : : :; (S 1 ; E 1)) satises f1 with re-
i i
torola stock. The formula indicates that the price for is entered. For each subformula g of f and for each
Motorola stock increases by 10% within 30 minutes. i 1, we inductively dene a boolean formula F
The formula states that there exists a past state such
g;i
as follows.
that: if X; t denote the values of price(Motorola)
and time in current state respectively, then there If g = R(t1; :::; t ) where R is an arithmetic re-
k
exists a past state before it in which the value of lation symbol such as , etc., then F = g;i
price(Motorola) is at most 90% of X and the time R(val(t1 ); :::; val(t )) where val(t ), for j =
k j
is more than or equal to t 10. Here, X and t are 1; :::; k, is the result of evaluating the term t in j
variables. We split the formula over two lines. the database state s . Any variables appearing
i
a sharp increase in price of the company denoted by If g = Lasttime g1 then F is dened as fol-
Y.
g;i
In the above formula, the variable Y can be con- If g = g1 Since g2 then F is dened as follows. g;i
panies.
The following PTL formula is an example of a If g = [x q] g1 then F = h where h is the g;i
condition that uses external events. This condition expression obtained after substituting the result
species that the value of attribute A has gone above of executing the query q in the database state
50 while user X is logged in. Note that the second s iinto the expression F 1 . g ;i
conjunct in the formula denotes that user X is still Note that of F can be computed incrementally
logged in. g;i
h = price(IBM) :5x ^ time t 10; relation retrieved by q on the database at that time,
g = Previously h. and by having T start = T and T end = MAX in
each tuple. . Later, as the value of query q changes
In the operation of the algorithm we use the (due to updates on the database), T start and T end
equivalences Previously h = true Since h. We are appropriately modied. It should be easy to see
consider the following history where each system that the value of the query q at any previous time
state is represented as a pair containing the value can be retrived by performing a selection, followed
of price(IBM) and time in that order. Here we do by a projection on R .
not show the update events.
x
false; g;i
F 1 ; F 2 = false;
the following optimization technique. If the value of
h; f;
F 2 _ F 1 ; F 3 = false; i
F 3 _ F 2 _ F 1; F 4 = true;
by the constant false and simplify the formula. We
h; h; h; f;
auxiliary relations is elaborated below. never be satised when t is substituted by any future
We assume that, in the given PTL formula f, each values of time, and hence we can replace all these
bound variable x is assigned a query value at most clauses by false and simplify F 4 to get F 4 = (t
g; g;
the highest integer less than or equal to i such that Here we show how the previous algorithm can be
the prex of the history up to (S ; E ) satises . extended to handle the temporal aggregates when
the aggregates do not contain any free variables.
j j
Now
consider the stock market example. The function is satised, and the aggregation is taken only at
sum(price(IBM); time = 540; time mod 60 = 0) those times when is satised. The computation of
denotes the sum of the the prices of the IBM stock this aggregate can be programmed into our rule sys-
taken every hour since 9AM (i.e. time = 540); tem. We rst introduce a new database item F and
here, we are assuming that value of time is given replace every occurrence of the function f(q; ; )
in minutes. The following expression denotes the in the condition of r by F. Next, we introduce two
hourly average of the IBM stock price since 9AM| new rules that update F. F is initialized by a rule
sum(price(IBM); time = 540; time mod 60 = with condition , and is updated by a rule with con-
0)/sum(1; time = 540; time mod 60 = 0). Note dition . We illustrate this construction using the
that the denominator, in the above expression, de- following example. Consider the following rule r.
notes the number of hour boundaries since 9AM. (Avg(price(IBM); time = 9AM; update stocks) > 70) ! A
In the above example, by appropriately choosing
the starting and sampling formulae, we can specify The above trigger res if the the average price of the
hourly or daily averages, or averages using sampling IBM stock since 9AM is higher than 70. We replace
points where some condition is satised. Suppose, the average by
update stocks denotes the T ransaction Commit sum(price(IBM); time =
event for a periodically run transaction that updates 9AM; update stocks)=sum(1; time =
all stock prices. Then, the following expression de- 9AM; update stocks).
notes the average of IBM stock price since 9AM, Since we have two dierent aggregates, we intro-
where the sampling points are instances when stock duce two new database items {CUM PRICE and
prices are updated| TOTAL UPDATES. The single rule r is replaced
sum(price(IBM); time = by the following three rules.
540; update stocks)/sum(1; time =
540; update stocks). r : (CUM PRICE=TOTAL UPDATES > 70) ! A;
r1 : time = 9AM ! require that A2 be executed ten minutes after the ex-
CUM PRICE := 0 ;T OT AL UPDATES := 0; ecution of A1 . Now consider the following rule r.
r2 : update stocks ! r : C(x) ! A(x)
CUM PRICE = CUM PRICE + price(IBM) The rule r can be implemented by the following two
T OT AL UPDATES + +; rules r1 and r2.
It is easy to see that the above approach can be
used, for any temporal condition, if the aggregates r1 : C(x) ! A1(x)
do not have any free variables. Note that all of the r2 : executed(r1; x; t) ^ time = t + 10 ! A2 (x)
above can be done automatically.
In a more general case, i.e. when f(q; ; ) has Many types of dependencies between commitment
free variables, we need to have multiple database of dierent transactions/actions of a nested transac-
items, indexed with dierent values for the free vari- tions have been studied in literature. These depen-
ables. For example, the following rule r(x), which dencies can be programmed into our formalism by
is similar to r except that the stock name IBM is using the dierent types of predicates/events. Tim-
replaced by a free variable x. ing dependencies among them can also be specied
elegantly in our formalism.
We can also use the executed predicate for pro-
(Avg(price(x); time = 9AM; update stocks) > 70) ! A gramming certain types of temporal actions. For
To handle the above rule, we introduce two example, a rule r may say that whenever condition
sets of database items, CUM PRICE(x) and C is satised execute an atomic action A every ten
T OT AL UPDATES(x), corresponding to the dif- minutes for the next one hour. For example, the
ferent values of x. As before, the rule r(x) will then condition C might say that price(IBM) < 60 and
be replaced by three rules r(x); r1(x) and r2 (x). action A may be buying of 50 IBM stocks3 . The fol-
lowing two rules together implement the above rule.
7 Temporal and Composite r1 : C ! A
Actions r2 : executed(r1; t) ^ (time t 60)
^(time t) mod 10 = 0 ! A
In this section, we describe how certain types of
composite and temporal actions can be implemented The executed predicate can be handled as follows.
elegantly by using a special predicate executed as The temporal component needs to maintain an ad-
part of the temporal conditions in rules. Essentially, ditional auxiliary relation denoting containing the
the executed predicate denotes which rules were ex- information about the execution of each rule, in-
ecuted at what time. The executed predicate takes cluding the parameter values and time. When this
three arguments r; x; t where r is a rule name, x is is done, we simply consider executed as a predicate
a list of parameters and t is time. The predicate on this auxiliary relation. In this auxiliary relation,
executed(r; x; t) is satised at time T if t < T and only information necessary for future evaluation of
the rule r was executed with parameter list given conditions will be maintained. All other information
by x (i.e. the condition part of r was satised, the will be removed as and when it is not needed.
rule was red and the action part of the rule was All the optimizations discussed in the previous
committed by the time t); sections can also be applied to the extensions dis-
Now, we show how the composite action can be cussed here.
expressed using the executed predicate. A compos-
ite action is specied by a set of atomic actions to-
gether with a partial order on them and a set of 8 Execution Model
timing constraints on their execution. The partial
denotes the order in which the individual atomic ac-
tions should be executed. Consider the a compos- In this section we will address some issues about
ite action A(x) which consists of two atomic actions the relationship between the user transactions and
A1 (x) and A2 (x). Here x denotes the parameters 3 Actually, this temporal action can be specied in future
that are passed to the action. The timing constraints temporal logic cite SW93.
the execution of the rules. As mentioned, the user To overcome this problem the temporal component
can specify for each rule any possible coupling be- invocation can be executed for multiple events at
tween user transactions and rules. For example, TC- the same time. The only implication of such an ac-
A denotes the coupling in which the condition of the tion is that trigger ring may be delayed, but not go
rule is executed as part of the user transaction, right unrecognized.
before the latter's commitment, i.e. when an event
attempts to commit occurs. Integrity constraints
are TCA rules, i.e. their condition and action are 9 Valid-time system model
executed as part of the user's transaction.
Now consider T-CA or T-C-A rules, i.e. rules 9.1 The model
that are executed independently of user transac-
tions. These rules seem to be more natural in tem- In the model we discussed so far we considered the
poral rule systems, since the condition satisfaction is transaction time rather than the valid time. Specif-
usually not attributable to a single transaction, but ically, our model and the temporal conditions re-
is the cumulative eect of the execution of many ferred to the time at which the values assigned to
transactions over time. In principle, each one of database items are committed.
these independent rules are evaluated whenever a In order to accommodate triggers that refer to
new system state is added to the history, i.e., when- the valid time we will assume that that every up-
ever an event occurs. Thus, whenever an event oc- date presented to the database management system
curs the database management system invokes the is associated with a valid time, and this valid time
temporal component, i.e. a system that executes may precede the current time. For example, the
the temporal condition evaluation algorithm for each update (IBM, 72) indicating that the price of the
trigger. Consistency constraints are evaluated only IBM stock is 72 may occur at 1pm and have a valid
when the attempt o ommit event occurs. time of 12:50pm. We assume that when this happens
t c
Obviously, this is only a schematic way of viewing the database management system makes the change
the evaluation process, and many optimizations are retroactively.
possible. For example, rules may be associated with In order to distinguish in the system history be-
relations or object classes, and evaluated only when tween the valid time and the transaction time, we
an event relating to the object class (e.g. an update modify our model. The valid time model is iden-
of an object in the class) occurs. tical to the transaction time model, except for the
In the ECA rule model the Event part played a following revisions. An update of the database is
performance optimization role, by forcing condition an event in both models. However, in contrast to
evaluation to be executed only when the respective the transaction time model, the event is assumed to
event occurs. We can obtain the same eect in our have occurred at the valid time, say v. If there is a
model as follows. Rules that refer in the condition system state with time-stamp v then the update is
part to events are considered only when the respec- added to the set of events E of that system state.
tive events occur, and disregarded otherwise. Rules Otherwise a new system state is added to the history
that do not refer to events, only to database evolu- with time-stamp v.
tion over time, are considered only at commit points, Furthermore, in the valid time model we do not
4 since this is the only time when the database assume that the changes occur at commit time, but
changes. Rules that refer only to database histo- at the valid time. Specically, the database state of
ries, but their condition can be satised only as a two consecutive system states is identical, unless the
result of the execution of some transaction T, can event set E contains an update of the database. If
add to the condition part the event commit(T), and so, then the new database state re
ects all and only
thus constrain the evaluation to occur only when T the database changes made by the updates (possi-
commits. bly from dierent transactions) that appear in E.
Thus, whenever an event occurs, the tempo- In other words, the new database state is identical
ral component considers only the relevant triggers. to the previous one, except for the changes to the
Even so, the overhead may become excessive, and database made by the updates that occurred at that
trigger evaluation may fall behind event occurrence. instance in time.
In the valid-time model we are still interested
4 A commit point in a history h is a state that contains the only in committed updates, and we ignore updates
commit transaction event. of aborted transactions. Indeed, it does not make
sense to re a trigger based on updates that will be update, the maximum dierence between the cur-
aborted. However, the time of the committed up- rent time and the valid time is at most . In other
dates is not the time of the transaction commit as words, an update cannot make a retroactive change
in the model discussed in previous sections, but the which goes back more than time units. The im-
time at which the update occurs. This is a subtle but plication of the maximum delay assumption is that
important distinction, which, as explained in the in- a committed value in the database can be in one
troduction, may make a trigger re in one model but of two states, denite or tentative. If the commit-
not in the other. ment occurred less than time units ago, the value
In order to restrict attention to committed up- is tentative, otherwise it is denite.
dates we rst need to dene the concept of a commit- Suppose that triggers are denite in the sense that
ted system history. Intuitively, given a system his- their actions can be taken based only on denite
tory h, the committed system history at a time t is a values. In this case a trigger res if its temporal
subhistory consisting of the changes made by trans- condition is satised by a history that is at least
actions that committed before t. Formally, given a time units old. Observe that in this case the ring is
system history h, an update made by a transaction delayed, and it occurs at least after the condition is
T is committed in h if h contains a system state in satised. In other words, denite triggers inherently
which the commit of T appears. Given a system imply a delayed ring.
history h, a committed history at time t is the prex In order to evaluate denite triggers, the temporal
p of h consisting of states having a time-stamp not component algorithm is still executed whenever a
higher than t, in which each system state that con- system state is added to the history. However, it
tains an update that is uncommitted in p is modied only considers the system states that have a time-
as follows. The database state in the system state is stamp that is at least time units smaller than the
modied to eliminate the eects of the each uncom- current time. Since the algorithm is incremental, it
mitted update. actually considers only the system states that have
not been considered in the prior invocation of the
9.2 Triggers algorithm.
Now consider rules in the valid time model. Can 9.3 Integrity constraints
a trigger re, i.e. the action part of the rule be
executed, when the temporal condition is satised by When does a committed history satisfy a temporal
a committed history? If the history can be modied integrity constraint? It turns out that there are two
retroactively at any point in time in the future, this possible ways to dene the notion of integrity con-
means that any history is tentative in the sense that straint satisfaction, one is oine and the other is
each database value is uncertain, and furthermore, online. Suppose that h is a complete history, i.e.
it remains tentative forever. an history in which every started transaction is ei-
Suppose that triggers are tentative in the sense ther committed or aborted. A temporal integrity
that their actions can be taken based on tentative constraint c is online-satised in h if the temporal
values. In order to evaluate tentative triggers, the formula c is satised by the committed history at
temporal component algorithm is executed when a time t, for all times t which denote commit points
system state is added to the history, as before. How- of transactions. A temporal integrity constraint c
ever, the temporal component does not consider only is oine-satised in h if the following condition is
the latest system state. It incrementally performs satised for the committed history at time innity,
the evaluation algorithm for each state starting with h0 . For all times t which denote commit points of
the oldest system state that was updated by the transactions the temporal formula c is satised by
transaction, until the last system state in the his- the committed history at time t.
tory. If the condition is satised for one of these Intuitively, the dierence between the two notions
states, then the trigger is satised and the action is of satisfaction is the following. Oine satisfaction
executed. means that the condition is satised at every commit
Now assume that tentative values can be queried point p; the history up to p contains all updates,
and viewed, but actions can only be based on def- including the updates of transactions that commit
inite values. When do values become denite? To after p. Note that these updates are not "visible"
answer this question we introduce the concept of a at time p. In contrast, online satisfaction means
maximum delay, denoted . It means that for every that the condition is satised at every commit point
p; the history up to p contains only the updates of history, and let h0 be its collapsed committed history.
transactions that commit at p or before p. A temporal integrity constraint c is online-satised
Now let us demonstrate that the two satisfaction on h0 if and only if it is oine-satised on h0 .
notions are dierent. Consider for example the fol-
lowing temporal condition. Whenever update u2 oc-
curs in the history, it is preceded by update u1. Now 10 Comparison to Relevant
suppose that update u1 is issued by transaction T1,
and update u2 by is issued by transaction T2, and Literature
consider the history in which the events occur in the Other Temporal Logics: The work that is clos-
following order: est to ours is presented in [1, 2, 22, 23]. In
u1, u2, commit-T2, commit-T1. [1, 2], Chomicki considers a rst order temporal logic
It can be veried that this history oine-satises the with past temporal operators (FPTL) for specifying
temporal condition, but it does not online-satisfy it. and maintaining Real-time Dynamic Integrity Con-
Similarly, it can be shown that a history can online- straints of relational databases. FPTL uses rst or-
satisfy a temporal condition, although it does not der quantiers, whereas PTL uses the assignment
oine-satisfy it. operator. This operator can be viewed as a form
Ideally, one would like to enforce oine- of quantication that naturally ensures safety [39]
satisfaction of temporal integrity constraints. How- of the formula. For example, the trigger condition
ever, practically only online satisfaction can be en- SHARP-INCREASE given in subsection 4.3 is nat-
forced, since at some point in time the system does ural, but it is considered unsafe and cannot be han-
not know which transactions will commit and which dled by the methods in [1, 2]. Furthermore, certain
ones will abort; therefore it cannot consider current types relative time conditions cannot be expressed
updates of transactions that will commit in the fu- concisely using the formalism of [2]. The following
ture. condition is one such example: Three events A; B; C
The way to enforce the integrity constraint is to occur in that order within a span of 60 minutes.
make the auxiliary relations changes and invoke the Additionally, Chomicki's logic and processing
temporal component at every commit point of a method are strongly tied to the relational model.
transaction. The temporal component algorithm The work presented in [22, 23] considers temporal
should evaluate the temporal condition at commit logic with future (as opposed to past) operators for
points in the history, starting with the one imme- specifying temporal integrity constraints. This logic,
diately following the earliest update of the current called Propositional Temporal Logic, does not allow
transaction, and ending with the committing trans- quantiers and thus is less expressive. In [36] we also
action. If the condition is violated at any one of concentrate on future TL (that uses future temporal
these points, then the transaction attempting to operators such as Until, Nexttime etc.) and do not
commit is aborted. This procedure enforces both discuss temporal actions, aggregates, or valid and
online and oine satisfaction, i.e. the resulting his- transaction times.
tory online- and oine- satises the integrity con- Event Expressions: Event expressions (EE) is
straints. However, when considering oine satisfac- another elegant formalism for specifying temporal
tion, it may have aborted transaction that shouldn't conditions [15, 16]. Event expressions are based on
have been aborted. regular expressions. They consider the basic events
A system history in the transaction-time model to be the letters of the alphabet, and the expression
can be obtained from a committed system history denes the order in which these basic events occur.
in the valid-time model by changing the database Regular-expressions and temporal-logic are two
states in the history to re
ect all the database dierent and widely-accepted formalisms for the
changes made by a transaction at commit time of specication and verication of concurrent pro-
the transaction, rather than the update time. A grams. While the former is algebraic based, the lat-
committed system history so modied is called a col- ter is logic based.
lapsed committed history. An event expression is processed by constructing a
The following theorem indicates that although the nite-state automaton. Since event expressions use
two satisfaction denitions dier in the valid-time all the operators of regular expressions and also use
model, they coincide in the transaction-time model. negations, it can easily be shown (see [35]) that the
THEOREM 2: Suppose that h is a complete size of the automaton can be superexponential in
the length of the event-expression, even when vari- algorithm determines, based on analysis of the given
ables (called attribute values in the terminology of temporal condition, which information to save, and
[16]) are not used. In this case, the space complex- for how long to do so.
ity of our algorithm does not suer from this super
exponential blow up.
The work in [15, 16] does not explicitly address 11 Conclusions
the specication of relative timing properties. We
assume that relative timing properties of events can In this paper, we have presented a unied formal-
be handled in EE by using a special clock-tick event, ism, based on Past Temporal Logic (PTL), for spec-
i.e., a special event that occurs at every clock-tick. ifying events and conditions in active database sys-
However, it is not clear how to eciently process tems. Our formalism allows temporal aggregates. It
such event expressions. also permits elegant specication of temporal as well
It is to be noted that [15, 16] also propose to sim- as composite actions. In addition to the language,
plify the ECA rules by combining the event and con- we have also presented an incremental algorithm for
dition parts of a rule. However, their processing al- processing conditions specied in the language. We
gorithm seems to emphasize the event part. have also shown that that one can use either valid
All the languages mentioned so far in this section time or transaction time in our system.
cannot handle temporal aggregate functions. The Based on the work presented in this paper, a sys-
importance of such functions was observed by the tem for processing trigger conditions specied by a
temporal-database researchers, e.g. [32]. subclass of PTL formulas called decomposable for-
mulas was implemented[8]. This system operates as
Other work on Triggers in Active follows. When a trigger condition is rst entered,
Databases: The other relevant work is the work it automatically identies and creates auxiliary rela-
on active databases (e.g. [5, 7, 4, 19]), on triggers tions. Later, whenever the database is updated, the
[3, 11, 25], and on rule-languages [21, 26, 28, 41, 20]. temporal component part of the system is invoked.
These works lack the temporal component in the fol- The temporal component updates the auxiliary re-
lowing sense. They concentrate on the specication lations and checks for the satisfaction of the condi-
of triggers that involve at most two database states: tion. This whole system was implemented on top of
the current one, and the previous one. In contrast, Sybase using Sybase triggers.
in this paper we address the more general temporal As part of the future work, it will be interesting
aspects in triggers. Also, the notion of time travel in to see if we can extend the specication logic and
POSTGRES [29] falls short of providing the ability the processing algorithm to include both the future
to specify complex queries on the way the database and past temporal operators (in our earlier paper
evolves over time. [36], we used only future temporal operators such as
Valid and Transaction Times: These two no- Until, Nexttime etc.). It would also be interesting to
tions of time were discussed in the context of active provide a graphical user interface for specifying the
databases in [12] 5 but that discussion was restricted temporal conditions.
to append-only databases, and it did not provide a
formalism for dealing with these various notions of
time.
Temporal Databases: The other database lit-
References
erature area that is relevant to our paper is temporal [1] J. Chomicki, History-less Checking of
databases [33, 34, 30, 27, 40]. Temporal databases Dynamic Integrity Constraints, IEEE
are designed to save information over time in order International Conference on Data En-
to accommodate ad hoc queries. Therefore, for ex- gineering, Phoenix, Arizona, Febraury
ample, when a stock price changes the new value 1992.
does not overwrite the previous one.
In contrast, in this work we assume that the [2] J. Chomicki, Real-Time Integrity Con-
database is designed to represent only the current straints, ACM Symposium on Principles
information, and new values overwrite old ones. Our of Database Systems, June 1992.
5 Actually [12] also considers decision time, and it makes [3] D. Cohen, Compiling Complex Database
interesting observations concerning various notions of time in Triggers, Proceedings of ACM SIGMOD
active databases. 1989.
[4] S. Ceri and J. Widom, Production Rules [16] N. H. Gehani, H. V. Jagadish and O.
in Parallel and Distributed Database En- Shmueli, Composite Event Specication
vironments, Proceedings of VLDB, 1992. in Active Databases: Model& Imple-
[5] S. Chakravarthy et. al., HiPAC: A mentation, Proceedings of the 18th In-
Research Project in Active, Time- ternational Conference on Very Large
Constrained Database Management, TR Databases, Aug. 1992.
XAIT-89-02, Xerox Advanced Informa- [17] M. Gertz and U. Lipeck, Deriving In-
tion Technology. tegrity Maintaining Triggers from Tran-
[6] S. Chakravarthy et. al., Composite sition Graphs, Proc. Int. Conf. on Data
Events for Active Databases: Semantics, Eng., 1993.
Contexts and Detection, Proc. VLDB 94. [18] E.N. Hanson, Rule Condition Testing
[7] U. Dayal, Active Database Management and Action Execution in Ariel, Proceed-
Systems, Proceedings of the Third Inter- ings of the ACM-SIGMOD 1992, Inter-
national Conference on Data and Knowl- national Conference on Management of
edge Bases|Improving Usability and Data, June 1992.
Responsiveness, Jerusalem, June 1988.
[19] E.
[8] M. Deng, Past Temporal Logic Trigger N. Hanson and J. Widom, An Overview
Evaluation System, Masters Project Re- of Production Rules in Database Systems
port, University of Illinois at Chicago, Research Report RJ9023, IBM Research
Department of EE and CS, 1994. Division, 1992.
[9] U. Dayal, M. Hsu, R. Ladin Organizing [20] A. Kotz, K. Dittrich and J. Mulle, Sup-
Long-Running Activities with Triggers porting Semantic Rules by a Generalized
and Transactions, Proc. ACM-SIGMOD Event/Trigger Mechanism, Proc. of the
Conf. 1990. EDBT'88, Springer Verlag LNCS 303.
[10] U. Dayal, M. Hsu, R. Ladin A Trans-
actional Model for Long-Running Activ- [21] G. Kiernan, C. de Maindreville, E.
ities, Proceedings of the 17th Conf. on Simon, Making Deductive Database a
VLDB, 1991. Practical Technology: A Step Forward,
Proc. of the ACM-Sigmod International
[11] M. Darnovsky Conf. on Management of Data, 1990.
and J. Bowman, "TRANSACT-SQL
USER'S GUIDE" Document 3231-2.1 [22] U. W. Lipeck and Gunter Saake, Mon-
Sybase Inc., 1987. itoring Dynamic Integrity Constraints
Based on Temporal Logic, Information
[12] O. Etzion, A. Gal and A. Segev, Retroac- Systems, 12(3):255-269, 1987.
tive and Proactive Database Processing,
Proc. of the 4th Int. Workshop on Re- [23] U. W. Lipeck and Gunter Saake, Using
search Issues in Database Engineering, Finite-Linear Temporal Logic for Speci-
Feb. 94. fying Database Dynamics, Lecture Notes
[13] A. Elmagarmid, editor, Data Eng. Bul- in Computer Science, Springer-Verlag
letin, Special Issue on Unconventional 1988.
Transaction Management, March 1991. [24] D.R. McCarthy and U. Dayal, The Ar-
[14] S. Gatziu and K. Dittrich, SAMOS: chitecture of An Active Database Man-
an Active Object-Oriented Database Sys- agement System, Proc. ACM-SIGMOD
tem, Data Engineering Bulletin, Dec. 92. 1989 Int'l Conf. Management of Data,
Portland, Oregon, May-June 1989, 215-
[15] N. H. Gehani, H. V. Jagadish and O. 224.
Shmueli, Event Specication in an Ac-
tive Object-Oriented Database, ACM- [25] T. Risch, Monitoring Database Objects,
SIGMOD 92. Proc. VLDB, Aug. 89.
[26] T. Sellis, Ed., Special Issue on Rule [38] D. Toman and J. Chomicki, Implement-
Management and Processing in Expert ing Temporal Integrity Constraints Us-
Database Systems, SIGMOD RECORD, ing an Active Database, Proc. of the
18(3), Sept. 1989. 4th Int. Workshop on Research Issues in
[27] A. Segev and H. Gunadhi, Event-Join Database Engineering, Feb. 94.
Optimization in Temporal Relational [39] J. D. Ullman, Principles of Database
Databases, Proc. VLDB, Aug. 1989. and Knowledge-Base Systems, Com-
[28] M. Stonebraker, A. Jhingran, J. Goh, puter Science Press, 1988.
and S. Potamianos, On Rules, Proce- [40] X. Wang, S. Jajodia, V. Subrahma-
dures, Caching and Views in Database nian, Temporal Modules: An Approach
Systems, Proc. of the ACM-Sigmod In- Toward Federated Temporal Databases,
ternational Conf. on Management of Proc. of the ACM-Sigmod International
Data, 1990. Conf. on Management of Data, 1993.
[29] M. Stonebraker and G. Kemnitz, The [41] J. Widom, S. Finkelstein, Set-Oriented
Postgres Next-generation Database Man- Production Rules in Relational Database
agement System, CACM, Oct. 91. Systems, Proc. of the ACM-Sigmod In-
[30] R. Snodgrass, ed., Data Engineering, ternational Conf. on Management of
Special Issue on Temporal Databases, Data, 1990.
Dec. 1988.
[31] R. Snodgrass and I. Ahn, The Temporal
Databases, IEEE Computer, Sep. 1986.
[32] R. Snodgrass, S. Gomez, E. McKenzie,
Aggregates in the Temporal Query Lan-
guage TQuel, IEEE Trans. on Knowl-
edge and data Eng., Oct. 1993.
[33] A. Segev and A. Shoshani, Logical
Modeling of Temporal Data, Proc. of
the ACM-Sigmod International Conf. on
Management of Data, 1987.
[34] A. Segev and A. Shoshani, The Rep-
resentation of a Temporal Data Model
in the Relational Environment, 4th Int.
Conf. on Statistical and Scientic Data
Management, June 1988.
[35] L. J. Stockmeyer (1974), The complex-
ity of decision procedures in Automata
theory and Logic, Doctoral Dissertation,
MIT, Cambridge, Project MAC Techni-
cal Report TR-133.
[36] A. P. Sistla and O. Wolfson, Temporal
Triggers in Active Databases, Univ. of
Illinois at Chicago, EECS Dept. Tech.
Report, 1993.
[37] A. Tuzhilin and J. Cliord, A Temporal
Relational Algebra as a Basis for Tem-
poral Relational Completeness, Proc. of
the 16th VLDB Conference, 1990.