Counting solutions to the View Maintenance Problem

We present an incremental evaluation algorithm for materialized views in relational and deductive database systems. The algorithm computes, in an incremental fashion, the changes to the materialized view in response to changes (insertions, deletions, and updates) to the base relations. The view may be deened in SQL or in Datalog, and may use UNION , negation, aggregation (e.g. SUM, MIN), linear recursion, and general recursion. The algorithm is optimal in that it computes exactly those view tuples that are inserted or deleted. The algorithm works by tracking the number of derivation trees ((Mum91, MS92]) for each tuple in the view. The number of derivation trees for a tuple corresponds to the count of a tuple in the duplicate semantics used in relational systems such as those based on SQL. For deductive databases using set semantics, we show that the number of derivation trees for nonrecursive queries can be computed at little or no cost above the cost of evaluating the query. For recursive queries, keeping track of derivation trees may require some additional work. A restriction of our algorithm is that it is applicable to a recursive query only if the number of derivation trees is nite.

[1]  Per-Åke Larson,et al.  Updating derived relations: detecting irrelevant and autonomously computable updates , 1986, VLDB.

[2]  Frank Wm. Tompa,et al.  Eeciently Updating Materialized Views , 1986 .

[3]  Frank Wm. Tompa,et al.  Maintaining materialized views without accessing base data , 1988, Inf. Syst..

[4]  Jennifer Widom,et al.  Deriving Production Rules for Incremental View Maintenance , 1991, VLDB.

[5]  Adrian Walker,et al.  Towards a Theory of Declarative Knowledge , 1988, Foundations of Deductive Databases and Logic Programming..

[6]  J. Lloyd Foundations of Logic Programming , 1984, Symbolic Computation.

[7]  Oded Shmueli,et al.  Finiteness Properties of Database Queries , 1993, Australian Database Conference.

[8]  Inderpal Singh Mumick,et al.  Magic-sets transformation in nonrecursive systems , 1992, PODS '92.

[9]  Teodor C. Przymusinski On the Declarative Semantics of Deductive Databases and Logic Programs , 1988, Foundations of Deductive Databases and Logic Programming..

[10]  Alon Itai,et al.  Maintenance of views , 1984, SIGMOD '84.

[11]  Salvatore J. Stolfo,et al.  Incremental evaluation of rules and its relationship to parallelism , 1991, SIGMOD '91.

[12]  Jeffrey D. Uuman Principles of database and knowledge- base systems , 1989 .

[13]  Eric K. Clemons,et al.  Efficiently monitoring relational databases , 1979, ACM Trans. Database Syst..

[14]  Serge Abiteboul,et al.  Data functions, datalog and negation , 1988, SIGMOD '88.

[15]  Jon Doyle,et al.  A Truth Maintenance System , 1979, Artif. Intell..

[16]  Gio Wiederhold,et al.  Incremental Recomputation of Active Relational Expressions , 1991, IEEE Trans. Knowl. Data Eng..

[17]  Hamid Pirahesh,et al.  The Magic of Duplicates and Aggregates , 1990, VLDB.

[18]  Inderpal Singh Mumick Query Optimization in Deductive and Relational Databases , 1991 .