22 Oct 2015

Maintaining views incrementally

http://dl.acm.org/citation.cfm?id=170066

count algorithm
tracks the number of alternative derivations (counts) for each derived tuple in the view
count for a tuple … be computed with little or no cost of deriving the tuple
Delete and Rederive algorithm, DRed
… for recursive views … The algorithm works by first deleting a superset of the tuples that need to be deleted, and then rederiving some of them.

recomputing the view from scratch is too wasteful in most cases … it is often cheaper to compute only the changes in the view.

incremental view maintenance algorithms
compute changes to view in response to changes to the base relations

view maintenance has applications in integrity constraint maintenance, persistent queries, active database (a rule may fire when a particular tuple is inserted into a view)

both algorithms use the view definition to produce rules that compute the changes to the view using the changes made to the base relation and the old materialized views.

the view definition (supported) can be in SQL or Datalog, and may use UNION, negation, aggregation (e.g., SUM, MIN), linear recursion, and general recursion.