Professional Documents
Culture Documents
CS240A: Databases and Knowledge Bases Applications of Active Database
CS240A: Databases and Knowledge Bases Applications of Active Database
Rules(s): Condition:
when operations that could There is some employee
make C become false violating C (due to those ops)
if C is false Action: make C true
then make C true
Rollback insertion of emp
or abort transaction
Rollback deletion of dept
Put emp into a dummy dept
Example:
C = every employee's
department must exist
Operations = insert into emp,
delete from dept,
update to emp.deptno,
update to dept.dno
Example: Referential Integrity
define view V as
select Cols from Tables
where Predicate
Materialized initially, stored in database
Refreshed at rule processing points
Changes to base tables => ViewMaintaining Rules
Recomputation approach (easy but bad)
when changes to base table then recompute view
Incremental approach (better but harder an not always applicable)
when changes to base tables then change view
Incremental rules is difficult in the presence of duplicates and certain
base table operations
Example
_______________________________________
Dept and Emp are switched in the ADS book
Incremental Refresh Rules