Start Stonebraker et al. - PowerPoint PPT Presentation

1 / 16
About This Presentation
Title:

Start Stonebraker et al.

Description:

Create rule audit_salary_review. on select to emp.salary. where current.name = Mike' ... Create alert alert_Mike_on_salary_review (mechanism = callback' ... – PowerPoint PPT presentation

Number of Views:25
Avg rating:3.0/5.0
Slides: 17
Provided by: TADCe
Learn more at: http://polaris.umuc.edu
Category:

less

Transcript and Presenter's Notes

Title: Start Stonebraker et al.


1
Start Stonebraker et al. Chap. 7
  • Chap. 7 Rules
  • O-R DBMS needs a powerful rule system
  • Four types
  • Update-update, query-update, update-query,
    query-query

2
Stonebraker et al. Chap. 7
  • Update-update
  • Update event occurs and then action is another
    update
  • Example on p. 102 next slide

3
UpdateUpdate Rules
  • Create rule Mike_Jane_salary_synch
  • on update to emp.salary
  • where current.name Mike
  • do update emp
  • set salary new.salary
  • where name Jane
  • Update emp
  • set salary 52500
  • where name Mike
  • (continue)

4
  • Create rule Mike_Emma_salary_synch
  • on update to emp.salary
  • where current.name Mike
  • (do update emp)
  • set salary current.salary
  • where name Emma
  • Update emp
  • set salary 56000
  • Where name Mike

5
Stonebraker et al. Chap. 7
  • Query-update
  • Query event and then update action
  • Example on p. 103 next slide

6
Query-Update Rules
  • Create rule audit_salary_review
  • on select to emp.salary
  • where current.name Mike
  • do insert into audit
  • values
  • (current.salary, user, current_datetime)

7
Stonebraker et al. Chap. 7
  • Update-query
  • Event is update and then generate a response to
    user
  • alert
  • p. 104 for example next slide
  • Can have listener or poll condition

8
Update-Query Rules
  • Create alert alert_Mike_on_salary_review
  • (mechanism callback)
  • Create rule alert_Mike_on_salary_change
  • on update to emp
  • where current.Name Mike
  • do raise alert alert_Mike_on_salary_review

9
Stonebraker et al. Chap. 7
  • Query-query
  • Event is retrieval and then action is retrieval
  • Instead command
  • See p. 105 for example next slide
  • Can be made to lie to unauthorized users.

10
Query-Query Rules
  • Create rule Jane_Mike_salary_synch
  • on select to emp.salary
  • where current.name Jane
  • do instead
  • select salary from emp
  • where name Mike

11
Stonebraker et al. Chap. 7
  • Bad part of rules
  • Multiple rules can fire and results become
    unpredictable
  • Infinite loops
  • Abort of transaction also aborts action on rule
    (eg. Audit trail fails)
  • State of database

12
Stonebraker et al. Chap. 7
  • Summary
  • Feature 1 rule system to support events and
    actions both updates and retrieves
  • Feature 2 rule system integrated with other O-R
    capabilities
  • Feature 3 see next slide
  • Feature 4 no looping

13
  • 3 - A rule system supports immediate, deferred
    and same transaction, different transaction
    execution semantics.

14
Stonebraker et al. Chap. 7
  • Give an example of a rule you could use in your
    database

15
Stonebraker and Brown
  • Feature 8 - Open Storage Manager
  • Open interface where third parties (not DBMS)
    can write storage managers
  • DBMS has access to specialized storage manager

16
Stonebraker and Brown
  • Stonebrakers vision
Write a Comment
User Comments (0)
About PowerShow.com