Definitionadvanced
Self-maintainable view
Also called self-maintainability.
A materialized view that can be updated from its old contents and the base changes alone, without reading the base relations.
A self-maintainable view is a materialized view whose new contents after a change to the base relations are a function of its old contents and the change, so that maintenance never reads the base relations. It is a property of the view definition together with a kind of change (insertions, deletions or both) and the integrity constraints, not of an algorithm. Delta rules give the change of any view but usually read the old base relations, and deferred view maintenance asks a related question about when the base relations are read.
Definition
Let be the set of legal databases (those that satisfy the constraints), and let be a class of changes, for example the insertions into relation . Write for the database after the change . A view is self-maintainable for if, for all and every such that and are legal,
Equivalently, there is a function with for every legal and every applicable . The first form is the one that refutes self-maintainability: two databases with the same view and the same change that give different new views are a proof that no exists.
A set of views is self-maintainable if the tuple of all their contents is: each new view is a function of the old contents of all of them and the change. The are auxiliary views. Their base case is the set of all base relations, which is always self-maintainable; the aim is to choose auxiliary views that are much smaller.
The answer depends on three choices: the class of changes, the semantics (sets or bags), and the constraints in . Keys and foreign keys, written as a functional dependency and an inclusion dependency, make smaller, so fewer pairs must agree and more views qualify.
Examples and non-examples
and are base relations. Each "no" row gives a pair of databases that refutes the property.
| view | change | semantics | self-maintainable | reason or counterexample |
|---|---|---|---|---|
| insert or delete in | sets or bags | yes | ||
| insert in | sets | yes | add | |
| delete in | sets | no | and both give ; deleting gives and | |
| insert or delete in | bags | yes | the counts of the view are the counts of derivations, and | |
| insert in | sets or bags | no | with or gives the empty view; inserting gives one tuple or none | |
| delete in | sets | yes | remove the view tuples whose part is the deleted tuple | |
| delete in | bags | no | and both give twice; deleting one gives 0 copies and 1 copy | |
| , with a key of and a foreign key to | insert in | sets or bags | yes | a new tuple of has a new key, which no tuple of references, so |
| insert in | bags | yes | the new maximum is the larger of the old one and the inserted value | |
| delete in | bags | no | groups and both give 5; deleting 5 gives 3 and no group | |
| delete in | bags | no | groups and both give 2; deleting 2 gives 0 and no group | |
| insert or delete in | bags | yes | both are sums over the group, and a count of 0 says the group is gone |
The join and auxiliary views. is not self-maintainable for insertions into , because the inserted tuple must meet tuples of that the view may not show. Under set semantics, the set with the auxiliary view is self-maintainable for insertions and deletions in and for deletions from , at the cost of storing . It is still not self-maintainable for insertions into : a tuple of with no match is in neither view, and a new tuple of can match it. Quass, Gupta, Mumick and Widom derive such auxiliary views from the view definition, push the selections of the view into them, and use keys and referential integrity to drop the auxiliary views that the constraints make unnecessary, as in the foreign key row of the table.
Bags change the answer. The set projection fails for deletions and the bag projection does not, because the bag view holds the count that the set view lost. The bag join fails for deletions and the set join does not, because in a bag the count of a view tuple is a product of two base counts that the view cannot split.
Related definitions
- Delta rules give for any view. A view is self-maintainable for a class of changes when its delta rules can be rewritten to read only and .
- Incremental view maintenance is the algorithm that applies the delta. In a data warehouse the base relations are at remote sources, and a self-maintainable view, with its auxiliary views, can be maintained without queries to the sources.
- Deferred view maintenance keeps logs of the base changes and refreshes later. A self-maintainable view needs only the logs, not the current base state.
- View selection chooses which views to materialize. The auxiliary views of a self-maintainable set are a choice of this kind, with maintenance cost in place of query cost.
- In a stream system, a view that is self-maintainable for insertions can take a late tuple at any time, because the change needs no old base data. A view that is not must keep the base data, or a summary of it, for as long as late data can arrive.
- An autonomously computable update, in the sense of Blakeley, Coburn and Larson, is the same idea for one given update and one given view contents, not for all databases.
References
- Data integration using self-maintainable views, the definition of a view that is self-maintainable for a kind of change, and the conditions for select-project-join views (general locator, pages not checked)
- Dallan Quass, Ashish Gupta, Inderpal Singh Mumick and Jennifer Widom, Making views self-maintainable for data warehousing, Proceedings of PDIS 1996, pages 158 to 169, the auxiliary views that make a view and its helpers self-maintainable together, and the use of keys and referential integrity to make the auxiliary views small
- Updating derived relations, detecting irrelevant and autonomously computable updates, the updates that can be applied to a derived relation from its contents and the update alone (general locator)
- Maintenance of materialized views, problems, techniques, and applications, the classification of maintenance problems by the information that is available, with the view and the change alone as the smallest case
About this page
The build computes these levels from the evidence in the repository. Each row says what the next level needs. Read what the levels mean.
| Ladder | Level | What the next level needs |
|---|---|---|
| Human proof | H0 no proof |
|
| Lean | L0 no Lean part |
|
| Visual | V0 none |
|
| Writing | W4 complete |
|
Tag 0XB7XD Edit this page History Report an error Markdown