17
Super-Key Classes for Updating Materialized Derived Classes in Object Bases Shin'ichi KONOMI 1, Tetsuya FURUKAWA1 and Yahiko KAMBAYASHI2 1 Computer Center, Kyushu University, Higashi, Fukuoka 812, Japan emaih {konomi, furukawa}@cc, kyushu-u, ac. jp 2 Integrated Media Environment Experimental Laboratory, Kyoto University, Sakyo, Kyoto 606, Japan emaih yahikoQkuis, kyoto-u, ac. jp Abstract. We describe data structures that allow efficient updates of materialized classes derived from relationship of classes in object bases. Materialization of derived classes reduces costs of retrievals and increases costs of updates. Costs of updates increase remarkably when several paths of objects derive the same object. If object bases satisfy the super- key condition proposed in this paper, consistencies of object bases are maintained by local navigations and the remarkable increase of the costs is avoided. Any object base can be transformed to satisfy the super- key condition by adding extra classes and their objects. In this manner, increasing redundancies allows efficient updates. 1 Introduction In databases, redundant data structures introduced to reduce costs of retrievals often increase costs of updates. Database management systems should allow efficient retrievals with minimal increase of update costs. Views in databases are proposed to provide flexibility without affecting un- derlying data. Views in object bases are also proposed introducing imaginary objects, virtual classes and virtual class hierarchies [1]. Costs of retrievals that are required to produce views depend on access paths of underlying data and complexity of view definitions. Materialization of views allows fast retrievals of views regardless of access paths of underlying data and complexity of view definitions. However, when updates occur in object bases, extra costs are required to keep materialized views consistent. Compared with replicated data in distributed databases, materialized views cause more expensive update overheads since they may require recomputation of views. The following example shows characteristics of updating materialized views. Example 1. Let us consider a video database. The whole sequences of frames (images) are partitioned into scenes. In Fig.l(a), Mick and Paul appear at Airport in Scene1, Mick, Paul, and a dog at Airport in Scene2, and Mick and John at Hotel in Scene3. Figure 1 (b) shows objects and their connections in the video database.

Super-Key Classes for Updating Materialized Derived Classes in Object Bases

Embed Size (px)

Citation preview

Super-Key Classes for Updating Materialized Derived Classes in Object Bases

Shin'ichi KONOMI 1, Tetsuya FURUKAWA 1 and Yahiko KAMBAYASHI 2

1 Computer Center, Kyushu University, Higashi, Fukuoka 812, Japan emaih {konomi, furukawa}@cc, kyushu-u, ac. jp

2 Integrated Media Environment Experimental Laboratory, Kyoto University, Sakyo, Kyoto 606, Japan

emaih yahikoQkuis, kyoto-u, ac. jp

Abstract. We describe data structures that allow efficient updates of materialized classes derived from relationship of classes in object bases. Materialization of derived classes reduces costs of retrievals and increases costs of updates. Costs of updates increase remarkably when several paths of objects derive the same object. If object bases satisfy the super- key condition proposed in this paper, consistencies of object bases are maintained by local navigations and the remarkable increase of the costs is avoided. Any object base can be transformed to satisfy the super- key condition by adding extra classes and their objects. In this manner, increasing redundancies allows efficient updates.

1 Introduction

In databases, redundant data structures introduced to reduce costs of retrievals often increase costs of updates. Database management systems should allow efficient retrievals with minimal increase of update costs.

Views in databases are proposed to provide flexibility without affecting un- derlying data. Views in object bases are also proposed introducing imaginary objects, virtual classes and virtual class hierarchies [1]. Costs of retrievals that are required to produce views depend on access paths of underlying data and complexity of view definitions.

Materialization of views allows fast retrievals of views regardless of access paths of underlying data and complexity of view definitions. However, when updates occur in object bases, extra costs are required to keep materialized views consistent.

Compared with replicated data in distributed databases, materialized views cause more expensive update overheads since they may require recomputation of views. The following example shows characteristics of updating materialized views.

Example 1. Let us consider a video database. The whole sequences of frames (images) are partitioned into scenes. In Fig.l(a), Mick and Paul appear at Airport in Scene1, Mick, Paul, and a dog at Airport in Scene2, and Mick and John at Hotel in Scene3. Figure 1 (b) shows objects and their connections in the video database.

311

Presencel and Presence2 are derived objects where Presencel is Mick's presence at Airport and Presence2 is Mick's presence at Hotel.

A'rp~176 II ~ Mick �9 Mick II "Mick

II Paul. �9 Paul II dog�9 .John

Scene 1 Scene2 Scene 3 (a)

Fig. 1. Video database

Scene1 Paul ~..~ I=, .. _

~ A~rpon Mick ~ c e n e 2 . . . . . / /

I " ~ ' - - - - ' ~ - - ~ ~ Hotel

John --- " , ~ " - " ~ " .S -'ne3 .~.~';"<'~Pre "-,.,ce sence 1

"~"Presence2

(b)

Suppose the derived objects are materialized and Scene2 is deleted in editing the video. Since Mick is at Airport in Scene2, Mick may lose his presence at Airport. However, after retrieving connections of objects, we find that he is still at Airport in Scenel. Thus, Presencel is not deleted. []

There are three different approaches for efficient maintenance of materialized views:

Op t ima l Ref resh F requency of Mater ia l ized Views: Analytical modeling and optimal refresh policies of materialized view maintenance are presented in [12].

Screening of U p d a t e s of Mater ia l ized Views: Blakeley et al.[2] present con- ditions for detecting when an update of a base relation cannot affect a derived relation and for detecting when a derived relation can be updated using only the data of the derived relation itself and the given update operation.

I nc remen ta l U p d a t e s of Mater ia l ized Views: The algorithm presented in [9] derives the minimal incremental relational expressions that need recompu- tation. Roussopoulos[10] discusses incremental updates of a stored collection of pointers pointing to records of underlying relations needed to materialize a view.

Here we focus on the third approach and discuss efficient methods of incremen- tM updates of materialized classes derived from relational expressions including projections.

In this paper, data structures that permit efficient incremental updates of materialized derived classes are described. When classes are derived from a path of classes in a class schema, the key of the path is defined to be utilized for updates. Class schemas satisfy the super-key condition presented in this paper if d@rived classes and the keys of the paths from which the classes are derived are contained in the same subgraphs of class schemas. If class schemas satisfy

312

the super-key condition, incremental updates are performed efficiently by de- tecting multiple paths of underlying objects utilizing objects of classes in keys. A procedure to transform class schemas so that they satisfy the super-key con- dition is presented. Though the procedure add extra classes and introduce more redundancies into object bases, it allows efficient deletions of objects.

Section 2 gives the definition of our model of object bases. Section 3 intro- duces materialized derived classes in object bases. Section 4 gives a procedure to maintain consistencies of materialized derived classes. Section 5 discusses data structures that allow efficient update propagations introducing the super-key condition and super-key classes. Section 6 describes design of object bases for efficient update propagations. Section 7 gives our conclusion.

2 A M o d e l o f O b j e c t B a s e s

The model described here focuses on connections of objects and relatioaships of classes from which classes are derived. Objects are values associated with their identifiers. Values of objects are assumed to be classified as follows:

bas ic values: The special symbol ni l or values from domain D, the union of all the domains in a database.

se t -values : A set { id l , i d 2 , . . . , idn} is a set-value where idi (1 < i < n) is an object identifier (OID).

tup le -va lues : Let idi (1 _< i < m) be an OID and ai (1 < i < m) be an attribute. < al : id l , a2 : id2, . . . , am : idm > is a tuple-value.

Objects belong to classes and classes are structured in class hierarchies with

ISA relationships, denoted by . . . . . Classes are defined when object bases are designed. One of the above types of values is assumed to be specified in each class. If tuple-values are specified in a class, attributes are also specified in the class.

Relationships of classes and connections of objects are classified as follows:

Set r e l a t i onsh ip s a n d set connec t i ons A set relationship from a class C to

a class C ~ is denoted by C --~ C ~. Objects in class C are set-value objects o = (id, { id l , id2, . . . , i da} ) and all the objects identified by ida, id2, . . . , idn are in class C . A set connection is a set of m links from object o to an object identified by idi (1 < i < m).

R e f e r e n c e r e l a t i onsh ip s a n d re fe rence connec t i ons A reference relation- ship from a class C to a class C ~ on attribute ai is denoted by C 25 C . C' , -*C is used instead of C -% C ~ if the attribute is trivial. The set of all the attribute of class C is denoted by A t t ( C ) . Objects in class C are tuple-value objects o = (id, < al : id l , a2 : id2, . . . , am : id,n >) and object o' identified by one of idi (1 < i < m) is in class C ~. A reference connection is a link from o to o ~.

ISA re l a t i onsh ips ISA relationship from a class C to a class C ~ is denoted by

C . . . . C I .

313

A class schema is a labeled directed graph S(V, E) where set of vertices V represents the set of all the classes in the schema and set of edges E represents the set of all the relationships of classes in the schema.

Example 2. Figure 2 shows a part of the class schema for the video database in Fig.1. Each vertex in the figure represents a class. ISA relationships in the fig- ure show that classes Person and Animal are subclasses of class Creature. Arrows with attribute names represent reference relationships. Objects in class Scene references objects in class Location as values of attribute Place, objects in class Animal or Persons as values of attribute Appearance. Arrows with doubled ar- rowheads represent set relationships. Objects in class Persons references objects in class Person as sets.

Person Persons Appearance ~_

O . . . . . . . . m.-@ Creature Animal

Scene Location Place ~ 0

:Class

. . . . . . - ~ :ISA relationship

:Reference relationship

:Set relationship

Fig. 2. Class schema for video database

[]

An object graph is a labeled directed graph O(v, e) where v is a set of vertices and e is a set of edges. Each vertex of v corresponds to one of a basic-value, a set-value or a tuple-value object. Each edge of e corresponds to a link in reference connections or in set connections.

Example 3. Figure 3 shows an object graph corresponding to the class schema in Fig.2. Objects in each class are encircled under the name of the class. [I

Defini t ion 1. Let S'(V', E') be a connected subgraph of class schema S(V, E) and O(v,e) and O'(v', e') be object graphs of S(V, E) and S'(V ~ E'), respec- tively. S'(V', E') and O'(v', e') are an class subschema of S(V, E) and an object subgraph of O(v, e), respectively. Note that O ~ is a subgraph of object graph O if O' is an object subgraph of O: n

Objects in object graph O(v, e) and classes in class schema S(V, E) are related by function inst. inst(C) represents all the object in class C. Paths of classes Ps = (C1, C2, . . . , Ca) is a path in the undirected graph that corresponds to class schema S. P is used instead of Ps if S is trivial, inst(Ps) is a set of paths p = (ol, 02, . . . , on) where oi E inst(Ci) (1 < i < n). Paths can be represented with lists of vertices assuming that only one edge exists between two adjacent objects.

314

Person Scene / / ~ Pers~ / / / ~ ~ , ~ i~

Fig. 3. Object graph

-~ Airport

-I~ Hotel

D e f i n i t i o n 2 . Let S be a class schema and Ps = (C1,C2,...,C~) be a path of classes. A relation of Ps, denoted by R(Ps), is relation R(C1, C2,..., C,). Instances of R(Ps) is a set of tuples (ol, o2 , . . . , os) where p = (ol, 02, . . . , o,) and p E inst(Ps). R(C1, C2,..., C8) is a relation in the relational model whose attr ibutes and tuples correspond classes and set of objects. []

Functional dependencies in relation R(P) are functional dependencies in rela- tion R(Cli C2,..., Cs) in the relational model. R(P)[Ci = o] and R(P)[ Ck,, Ck2, �9 . . , Ck,] denote selection and projection as in the relation model. Let P~ be a subgraph of P and {Ckl, Ck2, �9 �9 �9 Ck, } be the set of all the classes in P'. R(P)[P'] denotes projection R(P)[ C~,, Ck~,..., Ck,]. Note that R[P][P'] = R[P'].

ExampleS. Let P = (Person,Persons, Scene, Location) be a path of classes and functional dependencies Scene --~ Persons and Scene ---+ Location be asserted. Ta- ble 1 shows an instance of relational schema R(P). Since functional dependencies Scene ---* Persons and Scene ---, Location hold in R(P), a key of R(P) is {Scene, Person}.

Table 1. Relation of path (Person, Persons, Scene, Location)

Person Persons Scene Location ~ 1 04 06 09

O1 04 07 09

02 05 08 O10

03 04 06 09

03 04 O7 09

03 05 08 010

315

Functional dependencies in R(P) depend on relationships in class schemas. There is no functional dependency except for the trivial ones in R(C1, C2) where

C1 and C2 are classes such that C1 ~ C2 in class schema S(V, E). Functional dependency C1---*C2 holds in R(C1, C2) where C1 and C2 are classes such that C1"-*C2 in class schema S(V, E).

Defini t ion 3. Let P be a path of classes and C be a set of all the classes in P. A key of path P, denoted by key(P), is a minimal subset C' of C such that C ' ~ C holds in R(P). []

3 Materialized Derived Classes in Object Bases

When derived classes are materialized to allow fast retrievals, redundancies in- crease in object bases and costs of updates increase.

Example 5. In the class schema of Fig.4, class Presence is added to the class schema in Fig.2. Correspondences of locations and persons are easily retrieved from objects in class Presence.

Suppose object 07 of Scene is deleted. Since navigations from or gives o4, ol (Paul), and 09 (Airport), the connection between Ol (Paul) and 09 (Airport) may be lost after the deletion of 07. If no connection between ol (Paul) and 09 (Airport) exists, object 012 of class Presence should be deleted to keep the class schema consistent. However, after navigating from all the objects in class Scene, i.e., o6, 07, and o8, to class Person and to class Location we find Ol (Paul) and 09 (Airport) is still connected through 06 after the deletion of or. In this case, object o12 is not deleted. 13

An object derived from an object graph O is assumed to have tuple value < al : idl, as : id2, ..., a, : idm > where idi (1 < i < m) identifies an object in O. A class derived from a class schema S is a class of objects derived from an object graph of S.

Defini t ion 4. Let o be an object, C be the class of o, P be a path of classes, and p E inst(P). If every OID that appears as a value of object o is in p, o is an object derived from p, denoted by o <1 p. If, for every object o that belongs to C, there exists p E inst(P) such that o <1 p, C is a class derived from P, denoted b y C <l P. []

Derived class C can be materialized in the following manner for quick re- trievals of objects in C.

Given class schema S, path of classes Ps and class C + <1 Ps, C + can be added to S by merging S(V, E) and class schema S+(V +, E +) that is constructed as follows:

(1) Let C + be the class of tuple-value objects o = (id, < al : idl , a2 : id2, . . . , a n : i d m > ) . A d d C + t o V +.

316

Person Persons Scene Location 0 ~ < - ' ~ < Appearance ~ Place >.~

Presence (a) class schema

Person Scene Persons Location

P a u l ~ Airport J~ ~ o+ J \ 08 ] / ~ " o , 0 ] Mic Hotel

(b) object graph

Fig. 4. Introduction of materialized derived class and objects

(2) Let C~ be such a class in S that includes the object identified by idi for every object o in C +. Add an edge C+~,Ci to E + for each Ci.

S*(E*, E*) denotes an class schema obtained by merging S(V, E) and S+(V +, E+), i.e., V* = V U V + and E* = E U E +. Object graphs corresponding to S+(V +, E +) and S*(V*, E*) are denoted by O+(v + , e +) and O*(v*, e*), respec- tively. Class C + is called a materialized derived class.

Let Ps be a path of classes, C + <1 Ps be a materialized derived class, S*(V*, E*) be a class schema obtained by adding C + to S where S*(V*, E*) = S(V,E) U S + ( V + , E + ) . A + = V N V +, is the set of all the classes that be- long to bo~h S and S +. Let {P1, P~, . . . P,,} be the set of all the paths in S +. R(S +) = R(P1) t~ R(P2) ~ ... M P(P,~). R(S+)[A +] is a relation on attributes A + which is obtained from class schema S + . R(Ps)[A +] is a relation on attributes A + which is obtained from class schema S.

Def in i t ion 5. S*(V*, E*) is consistent iff R(S+)[A +] = R(Ps)[A+]. []

Example 6. In Fig.4(a), Presence is a materialized class derived from path (Person, Persons, Scene, Location), denoted by Presence <1 (Person, Persons, Scene, Location).

317

Objects in Presence are derived from paths in the undirected graph that corre- sponds to the object graph in Fig.4(b) as follows:

011 <1(03, 04, 06, 09) 012 <J(01,04, 06, 09) 013 <1 (03, os, os, 010) 014 <1 (02, os, o8,010)

011 ,a (03, 04, 07, 09) 012 <1 (01,04, o7, 09)

Let S*(V*, E*) denote the class schema. S* (V*, E*) = S(V, E)US+(V +, E +) where V = { Person, Persons, Scene, Location }, E = { Persons --~ P~rson, Scene

Persons, Scene ~ Location}, V + = {Person, Presence, Location}, and E + = { Presence-~ Person, Presence ~* Location}. []

4 M a i n t a i n i n g C o n s i s t e n c i e s a f t e r U p d a t e s

When an object is inserted, deleted or modified in class schema S* contain- ing materialized derived classes, propagation of updates may occur to keep S* consistent after the insertion, deletion or modification of objects. Let C + be a materialized derived class derived from a path of classes P. C + is updated based on preceding updates of P.

Processes required to update C + can be performed in three steps, i.e., candi- date retrieval, derivation test, and update. Path p inserted into inst( P) requires derivation of object o <1 p (candidate retrieval). Also, if o is not in inst(C +) pre- viously (derivation test), o must be inserted into inst(C +) (update). To check if o is in inst(C+), traversal of entire inst(C +) may be required. Pa th p deleted from inst(P) requires derivation of object o <1 p (candidate retrieval). Also, if p is the only path such that o <3 p in inst(P) (derivation test), o must be deleted from inst(C +) (update). Finding such a path except for p that o <1 p normally requires much cost since entire inst(P) are retrieved and object o <1 p are de- rived for every path p E inst(P) in the worst cases. In the following part of the paper, we reduce the costs of processes required to maintain consistencies after a deletion of an object.

Suppose C + <l P is updated. Followings are candidate retrieval and derivation test that are represented as relational expressions. Let object o of class C~ in P be inserted, deleted or modified.

C a n d i d a t e r e t r l e v a h Obtain R c = (R(P)[C u = o] M R(S+))[C+]. D e r i v a t i o n tes t : Obtain R c - ( R ( P ) [ C = # o] t~ R(S+))[C +]

Following part of this section gives a procedure that is sufficient to keep S* consistent after a deletion of an object in P. First, P~ is defined to trim P for C + .

Def in i t i on 6. Let C + <1 P be a materialized derived class. If P ' is the minimal subgraph of P such that satisfies C + <1 P ' , P ' is a corresponding path of C +, denoted by P ' I> C +. []

318

Only the updates of subgraph P~ of P affect objects in C +.

L a m i n a 7. Let P' i>C + be a subgraph of P. R(S+)[A +] - R(P)[A +] iff R(S+ )[A +] - R(p')[A+].

Proof. Since P ' is a subgraph of P, R(P') = R(P)[P']. Thus, R(P')[A +] = R(P)[P'][A +] = R(P)[A+]. If R(S+)[A +] = R(P')[A+], R(S+)[A +] = R(P)[A+]. Also, if R( S+ )[A +] = R( P )[A + ], R( S+ )[A +] = R( P')[A + ]. []

The following procedure updates materialized derived class C + after a dele- tion of an object in P~ such that P~ 1> C +. If V + contains more than one mate- rialized derived classes, apply the procedure to each of the materialized derived class. After applying the procedure, S* is consistent.

P r o c e d u r e 8. Let C + <1 P be a materialized derived class and P~ D C + be a subgraph of P. Given class schema S* and deleted object o of class Cu in P~.

(1) C a n d i d a t e Re t r i eva l : Navigate in P' to find a path p E inst(P') that contains o and then navigate from p to obtain a set of objects in C + that are connected to p. The obtained objects are the candidate objects, denoted by 0%

(2) D e r i v a t i o n Test : For each o c E o c, navigate in P~ to find all the paths in inst( P t) that do not contain o and o r <1 p.

(3) Dele t ion : I f no path is found for o c E o c in the preceding derivation test, o and o c are deleted. Otherwise, o is deleted. []

Since navigations in Step 1 is performed with only the paths in inst(P ~) that contains o, there is no need to traverse entire inst(P~). However, Step 2 may require to traverse entire inst(P ~) in the worst cases.

L e m m a 9 . Let S*(V*,E*) be a consistent class schema, C and C + be classes in S +, and P and pr be paths of classes where C + <1 P and pi t>_ C +. Suppose o E inst(C) is to be deleted. S* is consistent if Procedure 8 is applied to S*.

Proof. Let RI(X) and R2(X) be relational schemas and Y be a subset of at- tributes X. Since RI[Y] ~_ (R1 - R~)[Y] _~ ( R I [ Y ] - R2[Y]), (R1 - R~)[Y] = RI[Y] - R2[Y] + (R1 - R~)[Y].

Let AR(P') -- R(P')[C = o] be tuples to be deleted in R(P'). After deleting o in R(P'), R(P') becomes R(P') - AR(P') . Since (R1 - R2)[Y] -- RI[Y] - R2[Y] + (R1 - R2)[Y], (R(P') - AR(P'))[A +] = R(P')[A +] - AR(P')[A +] + (R(P') - AR(P'))[A+].

In Procedure 8, followings are performed:

(1) AR(P')[A +] is obtained in Step 1 of Procedure 8. (2) (R(P') - AR(P'))[A +] is obtained in Step 2 of Procedure 8. (3) R(S+ )[A +] is changed to Rnew(S+)[A +] where Rnew(S+)[A +] = R(S+)[A +]

- (AR(P')[A +] - ( R ( P ' ) - AR(P'))[A+])

319

Since S* is consistent before the deletion, R(S+)[A +] = R(P')[A+]. Then, R,~w(S+)[A +] = R(S+)[A +] - (AR(P')[A +] - ( R ( P ' ) - AR(P'))[A+]) = (R(P') - AR(P'))[A+]. Let R ( P ' ) - A R ( P ' ) be R ~ 0 (P') and R ( P ) - A R ( P ) be Rnew(P). The above equation is equivalent to Rnew(S+)[A +] = Rnew(P')[A+]. Rnew(S+)[A +] = Rnew(P)[A +] follows from Lemma 7. Thus, S* is consistent after the deletion if Procedure 8 is applied to S*. []

5 Efficient Deletions of Objects

In some cases, derivation test can be omitted in Procedure 8. This section in- cludes a condition satisfied by class schemas which allow to omit derivation test or to perform derivation test with only navigations on a single relationship.

First, an example of a class schema which does not require derivation test~is shown.

Example 7. Materialized derived objects are deleted when the objects they point to are deleted. Suppose object o9 is deleted in Fig.4. Objects ozz and oz2 which point to o9 are deleted without derivation test.

In the class schema presented in Fig.5, derivation test for derived class Per- son'sScene can be always omitted in applying Procedure 8. Suppose object 05 is deleted. Navigations from 05 gives (02, os, os) and (o3, 05, os) and ~andi- date objects o17 and o20 are obtained. Since paths in the instances of path (Person, Persons, Scene) and objects in class Person'sScene have one-to-one rela- tionship, there is no such a path p in the instances of path (Person, Persons, Scene) .such that o17 <1 p or 020 <1 p if 05 is deleted. Therefore, derivation test is not required to know O17 and 020 must be deleted. []

The following procedure is the same as Procedure 8 except that it does not include derivation test.

P r o c e d u r e 10.

(1) Step 1 of Procedure 8 (2) o and every object o c E o c obtained in the candidate retrieval are deleted.

[]

The next two lemmas show the condition of class schemas for always omitting derivation test.

L e m m a l l . Let S*(V*,E*) = S(V,E) U S+(V+,E +) be a consisten~ class schema, P and i~s subgraph P~ be such paths of classes that C+ <1 P and P* I>C +, and C be a class in P~. Suppose object o E inst(C) is deleted and Procedure 10 is applied to S*. I f functional dependency A + ~ C holds, S* is consistent.

320

Person Persons. Scene Location %~_~_~< APpearance 2 Place ~

Person'sScene (a) class schema

Person Scene

Paul

J o h n ~ l .,~,.,,,~ ~ ~ r . ~ / ~ / / , . , ~ ~ 1 ~ Airpo,

graph

Person'sScene

Fig. 5. Class schema containing super-key class

Proof. If there exists such a pair (ol,o2) of objects in inst(C) that satisfies R(P')[C = ol][A +] = R(P')[C = o2][A+], A + ---* C does not hold. Thus, if A + ~ C, no path is found in derivation test of Procedure 8. Since Procedure 10 is the sa-me as Procedure 8 except that it does not contain a step corresponding to Step 2 of Procedure 8, applying Procedure 10 is identical to applying Procedure 8. From Lemma 9, it follows that S" is consistent. []

L e m m a l 2 . Let S*(V*,E*) : S(V,E) U S+(V+,E +) be a consislent class schema, and P and pi be such paths of classes that C + <1 P and pi l> C +. Sup- pose objec~o in P' is deleted and Procedure 10 is applied to S*. IrA + D key(P'), S* is consistent.

Proof. Let P ' be (C1, C2 , . . . , C, ) . From the definition of key(P'), key(P') {(71, C2, . . . , Cn}. Since {C1,C2,. . . ,Cn} D_ {Ci} (1 < i < n), {C1, C2, . . . , C ,} ~ Ci. Thus, A+---~Ci (1 < i < n). From Lemma 11, it follows that as for a deletion of o 6 ins~(Ci) (1 < i < n), S* is consistent if we apply Procedure 10 to S*. []

In Fig.5, A + = {Scene, Person} and key(P') = {Scene, Person). From Lemma

321

12, it follows that the class schema in Fig.5 is consistent if we apply Procedure 10 to the class schema.

Let S* = S 4- S + be a class schema, C + (1 _< i <__ n) be a class in S +, S* - S + S + be the class schema obtained by adding C + to S. We denote by A + the set of all the classes in both class subschemas S and S + of S*.

Defini t ion 13. Let P' 1> C + (1 < i < n) be a path of classes in S*. S*(V*, E*) n

satisfies the super-key condition iff U A+ D_ key(P') for every P' in S*. If there i----1

exists a class C + such that Att(C +) D_ key(P'), C + is called a super-key class. B

From Lemma 12, it follows that if S* = S U S + satisfies the super-key condi- tion and S + contains only a super-key class except for the classes contained in S, S* is kept consistent by applying Procedure 10.

If S + contains more than one classes that are not contained in S, performing Procedure 10 for classes in S + is not sufficient to keep S* consistent. Even in this case, Procedure 8 is not required when S + is properly designed.

Example& In Fig.6, Person'sScene <:i (Person, Persons, Scene, Location) and Presence <1 (Person, Persons, Scene, Location). Since Presence and Person'sScene are derived from the same path of classes, an object of Presence can be updated according to objects of Person'sScene by navigating on the reference relationship between them. Note tha t the class schema contains super-key class Person'sScene and satisfies the super-key condition.

Person Persons Scene Location

t ~ Person'sScene ]

\~ 1

Presence

Fig. 6. Class schema allowing efficient deletions

Let {C +, C + , . . . , C + } be a set of classes in S + (V + , E +), and C + be a super- key class. If there exist reference relationships C+-...C + (2 < i < n), they can be utilized in candidate retrievals and derivation test. Reference connections of reference relationships C+....C + must be double-linked and satisfy relational expression (R(P) t~ R(S +)) [C + , C +] = R(C +, C +).

322

P r o c e d u r e 14. Let {C1+,C2+,...,C +} be a set of classes in S+(V+,E+), C1 + be a s u p e r - k e y c l a s s in L C+, , , . . . , C+, } , a n d (i < i < , ) be reference relationships in S +.

(1) C a n d i d a t e Retr ieval : Apply the Step I of Procedure 8 to C +, and let o~ be the set of candidate objects of C +. Navigate the links of C+-,~C+(2 < i < n) to find objects linked to an object in o~ and let the resulting objects be o~ ( 2 < i < n ) .

(2) Der iva t ion Test: Navigate the links of C+.,~C+(2 < i < n) from o~ (2 <_ i < n). Note that the connections of C+',~C + must be double-linked and satisfy (R(P) N R(S+))[C+,C +] = R(C+,C+).

(3) Delet ion: Delete o c E o~ if only one object ofC + is connected to o c. Delete all the object in o~ from C +. Delete o from C~. 0

L e m m a l b . Let S*(V*,E*) = S(V,E) U S+(V+,E+) be a consistent class schema where V + = {C +, C +, . . . , C+}, C + E V + be a super-key class, C+,,-*C + (2 < i < n) be reference relationships, and reference connections of C+-,~C + (2 < i < n) be double-linked and satisfy (R(Ps) ~ R(S+))[C+,C +] = R(C +, C+). If object o is deleted in S* and Procedure 14 is applied to S*, S* is consistent.

Proof. Let S~ = S U S + (1 < i < n) be the class schema obtained by adding class C + to S. We prove that every S~* (1 < i < n) is consistent.

S~ is consistent since applying Procedure 14 to C + is equivalent to applying Procedure 10 to C +. Applying Step 3 in Procedure 14 to S~ (2 < i < n) is the same as applying Step 3 in Procedure 8 to S/* (2 < i < n).

In Step 1 of Procedure 14, o~ corresponds to tuples obtained by evaluat- ing R~ = (R(P')[C = o] N R(S+))[C+]. To obtain o~ (2 < i < n) that corresponds to ~ = (R(P')[C = o] N R(S+))[C+], navigations on CI+..-*C + (2 < i < n) from o~ is performed producing pairs of objects corresponding to (Re1 N R(C+,C+))[C+]. Since R(C+,C +) = (R(P') N R(S+))[C+,C+],

(R~ N R(C+,C+))[C+ l = (R~ N (R(P') ~ R(S+))[C+,C+])[C +1 = ((R~ N

.(P,) .(s+))tct,ct])tctj = = o] . ( s + ) ) tct, ct]) tct] = (R(P')[C = o] N R(S+))[C +] = R~.

In Step 2 of Procedure 14, R~ = (R(P')[C r o] N R(S+))[C +1 (2 < i < n) need to be obtained. R~ = R(P')[C 7i o] N R(S+)[C +] = R(C +) - R~. In this step, processes corresponding to evaluating (R~ N R(C+,C+))[C +] are per- formed. Since (R(P) N R(S+))[C +, C +1 = R(C +, C+), (R~ N R(C +, C+)) [C +1 = (R~ N (R(P') N R(S+))[C +, C+])[C +] = (R~ N R(P') N R(S+))[C +, C+][C +1 = (R(P')[C r N R(S+))[C +, C+][C +] = (R(P')[C r N R(S+))[C +] = R~.

Thus, applying Procedure 14 to S* is equivalent to applying Procedure 10 to C + and Procedure 1 to each of C+(2 < i < n). 13

In Procedure 8, Steps 1 and 2 require navigations on entire P'. However in Procedure 14, Steps 1 and 2 require navigations on only a subgraph of P'. Navigations on class schemas can be classified as follows:

323

(1) Single-step navigat ion A navigation on a single relationship. (2) Mul t i - s tep navigat ion A navigation on multiple relationships.

T h e o r e m 16. Let S*(V*, E*) be a consistent class schema where S* = S U S +, + + { q , c~ , . . . , c+~ } be the set of all the classes in S+, C + be a super-key class

in S +, C+.,-*C+(2 < i < n) be reference relationships and reference connections of C+.,~C+(2 < i < n) be double-linked and satisfy (R(P) N R(S+))[C+,C +] = R(C +,C+). Suppose object o is deleted in S*. No multi-step navigation is required in the derivation test to keep S* consistent.

Proof. From Lemma 15, it follows that S* is consistent if Procedure 14 is applied to S*. Clearly, Procedure 14 requires no multi-step navigation in the derivation test. []

Although candidate retrieval requires multi-step navigations, only objects connected to o need to be retrieved.

Since the class schema in Fig.6 contains a super-key class Person'sScene and Presence is referenced by class Person'sScene, no multi-step navigation is re- quired to keep the class schema consistent if the reference connections between Person'sScene and Presence are double-linked.

6 Design of Object Bases Allowing Efficient Updates

This section gives a procedure to design object bases that allow efficient retrievals and updates. Generally, objects in object bases are retrieved quickly by intro- ducing redundancies into object bases. On the other hand, to reduce overheads to update redundant objects, redundancies should be reduced.

We introduce more redundancies into object bases to reduce overheads to update redundant objects. Let S* = S U S + be a class schema that contains materialized derived classes. When S* does not satisfy the super-key condition, multi-step navigations are required for each materialized derived class in S +. The next procedure transforms class schemas to satisfy the super-key condition and thus allow single-step navigations in keeping S* consistent after a deletion of an object.

P r o c e d u r e 17. Given a class schema S*(V*, E*),

(1) ~et C~ +, Cr C+~ be classes in S+ that have tuple-vatues and S; be a object schema obtained by adding C + to S. Obtain path P[ t> C + for 1 <

t I ! i< n. Let the set of all path P[ be {P~l,P~2,...,P~,.}. (2) L a CXkl, Gxk~ , �9 �9 �9 CXk,~ be s u p e r - k e u c lasses o f Ps P'k~, �9 �9 �9 P'k,~, i .e. , A t t ( C ~ )

_D key(P~i ). Construct an class schema from S* and C Kk~ , CKk2 , �9 �9 �9 cK,~ �9 (3) Add reference relationship CK"*~+k~ vkj if P~' t> C+kj" Note that reference con-

nection oeCK..-* ~+ must be double-linked and satisfy ( R( P) N R( S+))[C + J ki " ~ k j

c ~ ] = R( C,+ , C,+ ).

324

(4) Let the resulting class schema be S'(V', E'). n

T h e o r e m 18. Let S' be a consistent class schema transformed by Procedure 17. No multi-step navigation is required to keep S' consistent after a deletion of object o in P[.

Proof. Let S;, = S U S + (1 < i < m), {C+,C+, . . . ,C +} be the set of all the classes in Sk+ where C + <1 P'k, for (1 _< j _< s), and C Kk, be super-key class in S+,. Procedure 17 add C~ if it does not exist in {C +, C2+,..., C +} and adds reference relationships C~-,-*Cj (1 <_ j <<_ s, Cj # C~), whose connection are double-linked. From Theorem 16, it follows that S~ (1 < i < m) is consistent after the deletion if Procedure 17 is applied to S*. [3

Procedure 17 may increase the costs in keeping S* consistent after an inser- tion of an object. However, in general, the increase of the costs of an iasertion can be ignored compared to the decrease of the costs of a deletion.

Costs of retrievals in S* is not increased by Procedure 17.

T h e o r e m 19. Let S' be a class schema transformed by Procedure 17, O*(v*, e*) and O'(v', e') be object graphs of class schema S*(V*, Z*) and S'(V', E'), respec- tively. If O(v, e) is an object subgraph of O* that is accessed to perform retrieval query Q in S*, O(v,e) is also an object subgraph of O'(v',e').

Proof. Since Procedure 17 either adds classes or reference relationships to S* to obtain S', S' subsumes S*. Thus, an object subgraph of S* is also an object subgraph of S'. [ ]

Theorem 19 implies that retrieval query Q can be performed in the same object subgraph of both S* and S'.

Ezample 9. The class schema in Fig.6 is transformed from the class schema in Fig.4 by Procedure 17. Connection of objects between classes Person'sScene and Presence is shown in Fig.7. Person'sScene is a super-key class of the class schema in Fig.6.

Person'sScene

(0X15 016 017 018 019 0 2~ ~11 IV,,Q.,..,,,~I ,,,I

o12 ~ Presence

Fig. 7. Reference connection for efficient candidate retrieval and derivation test

325

Suppose object 07 is deleted. Navigations from or gives {or, 04, oz} and {07, 04, 01}. 016 and 019 are candidate objects in Person'sScene since they refer {07, 01} and {o7,0a}, respectively. Also, 012 and 011 are candidate objects in Presence since they refer 016 and 019, candidate objects in the super-key class Person'sScene. 016 and 019 is deleted without derivation test. 012 and 011 are not deleted from Presence since navigations from 012 and 011 in Presence give 015 and 01s, respectively.

Suppose object 021 referencing 04 and 09 is inserted in class Scene. Naviga- tions from 0~1 gives {021, 04,03, 09} and {021,04, 01,09}. First, 02z referencing

Person sScene. o21 and 03 and o23 referencing o21 and ol are inserted in class ~ ' Since there exist object oll referencing o3 and o9 and object o12 referencing Ol and o9, no object is inserted in class Presence .

Retrievals of corresponding persons and locations in Fig.6 is performed in the same manner as in Fig.4 using class Presence. 13

7 Conclus ion

If objects derived from several paths of objects are materialized in object bases, elimination of duplicates is required in performing incremental updates of ma- terialized derived classes as is required in incremental updates of materialized views produced by relational expressions that include projections. The elimi- nation of duplicates complicates incremental updates. Roussopoulos[10] decided not to discuss projections in incremental maintenance of ViewCache. Also, Qian and Wiederhold[9] pointed out the difficulty of the project operators for incre- mental recomputation of views. In this paper, we have described the super-key condition that allows efficient maintenance of materialized derived classes. Du- plicates can be efficiently eliminated in performing incremental updates if object bases satisfy the super-key condition. We began by defining our model of object bases introducing class schemas, object graphs and functional dependencies de- fined on relations of connected objects. Class schemas always keep the condition of consistencies if we perform Procedure 8 that incrementally updates materi- alized derived classes after every update. Derivation test in Procedure 8, which requires to obtain ins t (P ' ) for every candidate object in some cases, is omit- ted or performed as single-step retrievals if class schemas satisfy the super-key condition and contain super-key classes. Finally, we presented a procedure that transforms class schemas to satisfy the super-key condition.

Although it might be possible to define derived set-value objects and derived basic-value objects, only tuple-value objects are defined as materialized derived objects to simplify our discussion. The idea of the paper can be applied to de- rived set-value and derived basic-value objects with small modifications. It calls for further discussion of ISA relationships. Implementations of ISA relationships may affect efficiencies of updates of materialized derived classes in object bases. For example, objects of superclasses may have to be retrieved from their sub- classes in candidate retrieval and derivation test. Implementation related issues include directions of reference relationships, available access paths, e.g., pointers,

326

indices, and hashings. Object migrations in ISA hierarchies influence consisten- cies of object bases. Object migrations can be treated as insertions and deletions of objects if we leave the problem of object identifiers.

References

1. S. Abiteboul and A. Bonnet, Objects and Views, Proc. ACM SIGMOD Int. Conf. Management of Data, pp.238-247, 1991.

2. J. A. Blakeley, N. Coburn and P. Larson, Updating Derived Relations: Detecting Irrelevant and Autonomously Computable Updates, ACM Trans. Database Syst., Vol.14, No.3, pp.369--400, 1989.

3. F. Bancilhon and N. Spyratos, Update Semantics of Relational Views, ACM Trans. Database Syst., Vol.6, No.4, pp.557-575, Dec. 1981.

4. T. Barsalou and N. Siambela, Updating Relational Databases through Object-Based Views, Proc. ACM SIGMOD Int. Conf. Management of Data, pp.248-257, 1991.

5. A. Kemper, C. Kilger and G. Moerkotte, Function Materialization in Object Bases, Proc. ACM SIGMOD Int. Conf. Management of Data, pp.258-267, 1991.

6. S. Konomi and T. Furukawa, Updating Duplicate Values in Distributed Multi- database Systems, Proc. IEEE 1st Int. Workshop on Interoperability in Multi- database Syst., pp.243-246, Apr. 1991.

7. R. Langerak, View Updates in Relational Databases with an Independent Scheme, ACM Trans. Database Syst., Vol.15, No.l, pp.40-66, Mar. 1990.

8. C. Lecluse, P. Richard and F. Velez, O2~ an Object-Oriented Data Model, Proc. ACM SIGMOD Int. Confi Management of Data, pp.424-433, 1988.

9. X. Qian and G. Wiederhold, Incremental Recomputation o] Active Relational Ex- pressions, IEEE Trans. Knowledge and Data Eng., Vol.3, No.3, pp.337-341, 1991.

10. N. Roussopoulos, An Incremental Access Method for ViewCache: Concept, Algo- rithms and Cost Analysis, ACM Trans. Database Syst., Vol.16, No.3, pp.535-563, 1991.

11. P. Shoval, One-to-One Dependencies in Database Design, IEEE Trans. Knowledge and Data Eng., Vol.3, No.3, pp.371-379, 1991.

12. J. Srivastava and D. Rotem, Analytical Modeling of Materialized View Mainte- nance, Proc. ACM Symp. on Principles of Database Syst., pp. 126-134, 1988.

13. G. E. Weddell, Reasoning about Functional Dependencies Generalized/or Semantic : Data Models, ACM Trans. Database Syst., Vol.17, No.l, pp.32-64, Mar. 1992.