CS 240A: Databases and Knowledge Bases Analysis of Active Databases Carlo Zaniolo Department of Computer Science University of California, Los Angeles.

Slides:



Advertisements
Similar presentations
DB glossary (focus on typical SQL RDBMS, not XQuery or SPARQL)
Advertisements

Active database concepts
Design Issues for General-Purpose Adaptive Hypermedia Systems Hongjing Wu, Erik de Kort, Paul De Bra Eindhoven University of Technology The Netherlands.
Aberystwyth University Department of Computer Science 1 Lessons from engineering: Can software benefit from product based evidence of reliability? Neal.
1 Constraints, Triggers and Active Databases Chapter 9.
CS240A: Databases and Knowledge Bases From Deductive Rules to Active Rules Carlo Zaniolo Department of Computer Science University of California, Los Angeles.
CS240A: Databases and Knowledge Bases From Deductive Rules to Active Rules Carlo Zaniolo Department of Computer Science University of California, Los Angeles.
Results of the survey and relational dbs Fall 2011.
Requirement Analysis and Specification Mr. Manoj Kumar Kar.
SQL Constraints and Triggers
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 5 More SQL: Complex Queries, Triggers, Views, and Schema Modification.
Transaction Processing Lecture ACID 2 phase commit.
CS240A: Databases and Knowledge Bases Introduction Carlo Zaniolo Department of Computer Science University of California, Los Angeles WINTER 2002.
CS240A: Databases and Knowledge Bases Time Ontology and Representations Carlo Zaniolo Department of Computer Science University of California, Los Angeles.
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 23 Slide 1 Software testing.
Programming Language Semantics Mooly SagivEran Yahav Schrirber 317Open space html://
1 ACID Properties of Transactions Chapter Transactions Many enterprises use databases to store information about their state –e.g., Balances of.
1 A Closer Look Chapter 2. 2 Underlying Concepts of Databases and Transaction Processing.
CS240A: Databases and Knowledge Bases Applications of Active Database Carlo Zaniolo Department of Computer Science University of California, Los Angeles.
A Guide to Oracle9i1 Advanced SQL And PL/SQL Topics Chapter 9.
Semantics with Applications Mooly Sagiv Schrirber html:// Textbooks:Winskel The.
Testing an individual module
CS240A: Databases and Knowledge Bases Time Ontology and Representations Carlo Zaniolo Department of Computer Science University of California, Los Angeles.
CMPT 354, Simon Fraser University, Fall 2008, Martin Ester 157 Database Systems I SQL Constraints and Triggers.
©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 5 Slide 1 Requirements engineering l The process of establishing the services that the.
Database Constraints. Database constraints are restrictions on the contents of the database or on database operations Database constraints provide a way.
1 CS222: Principles of Database Management Fall 2010 Professor Chen Li Department of Computer Science University of California, Irvine Notes 01.
CS 240A: Databases and Knowledge Bases Introduction to Active Databases Carlo Zaniolo Department of Computer Science University of California, Los Angeles.
Triggers Event handlers in the DBMS. Triggers are event handlers Triggers a executed when an event happens in the DBMS Example events – INSERT, UPDATE.
Context Tailoring the DBMS –To support particular applications Beyond alphanumerical data Beyond retrieve + process –To support particular hardware New.
Lecture 7 Integrity & Veracity UFCE8K-15-M: Data Management.
1212 / Department of Computer Science Adaptive Hypermedia 2ID20 Prof. dr. Paul De Bra.
Next-generation databases Active databases: when a particular event occurs and given conditions are satisfied then some actions are executed. An active.
Department of Computer Science and Engineering, HKUST 1 More on Isolation.
DATABASE TRANSACTION. Transaction It is a logical unit of work that must succeed or fail in its entirety. A transaction is an atomic operation which may.
FALL 2004CENG 351 File Structures and Data Management1 Relational Model Chapter 3.
Black Box Testing Techniques Chapter 7. Black Box Testing Techniques Prepared by: Kris C. Calpotura, CoE, MSME, MIT  Introduction Introduction  Equivalence.
Lecture 1: Overview of CSCI 485 Notes: I presented parts of this lecture as a keynote at Educator’s Symposium of OOPSLA Shahram Ghandeharizadeh Associate.
Chapter 1 Introduction to Databases. 1-2 Chapter Outline   Common uses of database systems   Meaning of basic terms   Database Applications  
Triggers. Why Triggers ? Suppose a warehouse wishes to maintain a minimum inventory of each item. Number of items kept in items table Items(name, number,...)
CS240A: Databases and Knowledge Bases Recursive Queries in SQL 1999 Carlo Zaniolo Department of Computer Science University of California, Los Angeles.
Fall 2001Database Systems1 Triggers Assertions –Assertions describe rules that should hold for a given database. –An assertion is checked anytime a table.
Dec 8, 2003Murali Mani Constraints B term 2004: lecture 15.
7 1 Constraints & Triggers Chapter Constraints and triggers? Constraints: Certain properties that the DBMS is required to enforce –E.g. primary.
Topics Related to Attribute Values Objectives of the Lecture : To consider sorting relations by attribute values. To consider Triggers and their use for.
Copyright, Harris Corporation & Ophir Frieder, The Process of Normalization.
Design - programming Cmpe 450 Fall Dynamic Analysis Software quality Design carefully from the start Simple and clean Fewer errors Finding errors.
CS 240A: Databases and Knowledge Bases Introduction to Active Databases Carlo Zaniolo Department of Computer Science University of California, Los Angeles.
Reasoning about the Behavior of Semantic Web Services with Concurrent Transaction Logic Presented By Dumitru Roman, Michael Kifer University of Innsbruk,
Session 1 Module 1: Introduction to Data Integrity
Top-K Generation of Integrated Schemas Based on Directed and Weighted Correspondences by Ahmed Radwan, Lucian Popa, Ioana R. Stanoi, Akmal Younis Presented.
Chapter 18 Object Database Management Systems. Outline Motivation for object database management Object-oriented principles Architectures for object database.
CS 240A: Databases and Knowledge Bases Analysis of Active Databases Carlo Zaniolo Department of Computer Science University of California, Los Angeles.
CS240A: Databases and Knowledge Bases Recursive Queries in SQL 2003 Carlo Zaniolo Department of Computer Science University of California, Los Angeles.
Database Management COP4540, SCS, FIU Database Trigger.
Integrity Prof. Yin-Fu Huang CSIE, NYUST Chapter 9.
CS240A: Databases and Knowledge Bases TSQL2 Carlo Zaniolo Department of Computer Science University of California, Los Angeles Notes From Chapter 6 of.
1 CS 430 Database Theory Winter 2005 Lecture 7: Designing a Database Logical Level.
LECTURE TWO Introduction to Databases: Data models Relational database concepts Introduction to DDL & DML.
CS422 Principles of Database Systems Stored Procedures and Triggers Chengyu Sun California State University, Los Angeles.
Copyright © 2004 Pearson Education, Inc.. Chapter 24 Enhanced Data Models for Advanced Applications.
1 Constraints and Triggers in SQL. 2 Constraints are conditions that must hold on all valid relation instances SQL2 provides a variety of techniques for.
CS4222 Principles of Database System
Chapter 8: Concurrency Control on Relational Databases
Foreign Keys Local and Global Constraints Triggers
Introduction to Database Systems, CS420
Test Case Test case Describes an input Description and an expected output Description. Test case ID Section 1: Before execution Section 2: After execution.
SQL – Constraints & Triggers
CS240A: Databases and Knowledge Bases TSQL2
Outline Introduction Background Distributed DBMS Architecture
Presentation transcript:

CS 240A: Databases and Knowledge Bases Analysis of Active Databases Carlo Zaniolo Department of Computer Science University of California, Los Angeles WINTER 2002 Notes From Chapter 4 of Advanced Database Systems by Zaniolo, Ceri, Faloutsos, Snodgrass, Subrahmanian and Zicari Morgan Kaufmann, 1997

Properties of rule execution  Termination: For any legal transaction, the subsequent rule execution terminates.  Confluence:For any legal transaction, the subsequent rule execution terminates in the same final state.  Identical observable behavior: For any legal transaction, the subsequent rule execution is confluent and produces the same output sequence.

Analysis of Termination An active database has Non­Terminating Behavior iff there exists at least one transaction which produces non­terminating rule processing.  Triggering Graph (TG):  Directed graph {V, E}  Node v i  V correspond to rule r i  R  Arc  r j,r k   E means that the action of rule r j generates events which trigger rule r k  Acyclicity of the triggering graph implies the absence of non-terminating behaviors

Two rules creating an arc CREATE RULE T1 FOR Table1 WHEN... IF... THEN UPDATE Table1.Attr1... CREATE RULE T2 FOR Table1 WHEN UPDATED(Attr1) IF... THEN...

Cyclic Rules  With termination: CREATE RULE SalaryControl ON Emp WHEN INSERTED, DELETED, UPDATED (Sal) IF ( SELECT AVG (Sal) FROM Emp ) > 100 THEN UPDATE Emp SET Sal =.9 * Sal  Without termination: CREATE RULE SalaryControl2 ON Emp WHEN INSERTED, DELETED, UPDATED (Sal) IF ( SELECT AVG (Sal) FROM Emp ) > 100 THEN UPDATE Emp SET Sal = 1.1 * Sal

Improving Rule Analysis  Eliminate edge between two rules when:  The condition of r j is guaranteed to be false after the execution of r i.  The new data produced by r i do not satisfy the condition of r j.

Example of second case: Grade range rules CREATE TRIGGER CheckGradeDomain1 AFTER UPDATE OF Exam ON Grade REFERENCING NEW AS N FOR EACH ROW WHEN (N.Grade > 30) UPDATE Exam SET Grade = NULL WHERE ExamNumber = N.ExamNumber CREATE TRIGGER CheckGradeDomain2 AFTER UPDATE OF Exam ON Grade REFERENCING NEW AS N FOR EACH ROW WHEN (N.Grade < 18) THEN UPDATE Exam SET Grade = NULL WHERE ExamNumber = N.ExamNumber

Confluence  Confluence is the property that there only one final result (even when execution is nondeterministic)  This is often called Church-Rosser property, and the Knuth-Bendix algorithm can be used (in some cases) to determine if a given set of rules has this property  Set-oriented Rules (I.e., statement level triggering event)  Confluence is an issue when there is no total order between rules.  For tuple-oriented rules (e.g., for each row) confluence is an issue even if the rules are totally ordered.  In general confluence is hard to assure and might not be necessary.

Confluence (cont.)  Tuple-oriented Rules  Confluence is much harder to ensure; it requires that the final state does not depend on the system's controlled order in which tuples are accessed.  But: Confluence is not necessary or desirable in many cases.  Mutating table exception, when a table that is currently being updated also needs to be changed by a rule; may reveal lack of confluence.  Sufficient condition for confluence: Commutativity of two rules r 1 and r 2 : if for any database state, rule r i and then rule r 1 followed by r 2 produces the same database as r 2 followed by r 1.

Confluence: Commutative Rules create trigger T1 for C1 events modify(A1) condition C1(X), X.A1=7 actions modify(C1.A2,X,A2+1) end; create trigger T2 for C1 events modify(A1) condition C1(X), X.A1=7 actions modify(C1.A2,X,A2+2) end;

Observable Determinism  For every input application, rule processing execution terminates in the same final state with the same output sequence (messages, display activities, reports).  Unlike confluence, observable determinism is not necessary or desirable in many cases.  Rules may be confluent but not satisfy observable determinism: create trigger T1 for C1 events modify(A1) condition C1(X), X.A1=7 actions display(I where integer(I), I=X.A2) end; create trigger T2 for C1 events modify(A1) condition C1(X), X.A1=7 actions modify(C1.A2,X,A2+2), display(I where integer(I), I=X.A2) end;

Modularization Techniques for Active Rule Design  The main problem with rules: understanding their interaction.  This is not just a design issue, but rather a maintenance problem--The AI experience: XCON  Understanding rules after their design is quite hard.  Adding one rule to a rule set may lead to unexpected behaviors.  The main reason: lack of modularization devices for active rules.

Modularization by Stratification  Stratification: partitioning of rules into disjoint strata such that each strata includes ``uniform'' rules.  Benefit: Rule behavior can be abstracted by:  Reasoning ``locally" on each individual stratum  Reasoning ``globally" of the behavior across strata  A key design principle for providing rule modularization and control.

Rule Debugging and Monitoring  Purpose: run­time debugging and monitoring for tuning active rules' behavior.  Commercial systems lack of debugging and monitoring tools.  Minimum requirement: trace facility­-but even this often unavailable.  Some research prototypes offer powerful debuggers (e.g., Chimera)

Conclusions  Database production rules are:  Very powerful  Very widespread (on almost all relational products)  Very difficult to program—even harder to maintain  Active rule products must be enhanced:  Many products are ``implemented'', with severe limitation and sometimes ill­defined semantics  SQL99 is now published cleans up several problems --but others remain.  Concepts such as stratification will hopefully soon become a widespread notion for improving design  Declarative interfaces are possible for many active database applications integrity constraints, materialized views, virtual views, authorization, dependency control, deduction, versions,workflow management, resource management,....