Title: Scalable Trigger Processing
1Scalable Trigger Processing
- G04
- Betsy George
- Vijay Gandhi
2Problem Definition
- Given A Relational DBMS and Trigger statements
- Find Predicate Index Structure of Triggers
- Objective Minimize the trigger processing time
- Constraints
- Number of distinct structures of trigger
expressions is small - All distinct structures of trigger expressions
should be small enough to fit in the main memory
3Motivation
- Internet programming
- Web users can create personalized triggers
- Active Databases
- Stream-based applications
4Related Work
- ECA Model Indexing Parallel
(not scalable) Processing -
Gupt89,Hell98 - Range Predicates AI
- Hans96b
Forg82,Mira87 - (large memory)
(smaller rule set)
5Contribution
- Trigger processing Architecture
- Concurrent processing
6Key Concepts TiggerMan Architecture
7Key Concepts Trigger Structure
trigger name tokens event selection
predicate selection predicate join
predicate action
- Create trigger
- T1
- From
- bank_account, checking_account
- On
- update(bank_account)
- when
- bank_account.id X
- And bank_account.balance lt 10000
- And bank_account.id checking_account.id
- do
- notify_by_email(X)
8Key Concepts Exercise to audience
- Create trigger
- T2
- From
- bank_account
- On
- update(bank_account)
- when
- bank_account.id Y
- And bank_account.balance lt 20000
- do
- notify_by_email(Y)
- Create trigger
- T3
- From
- bank_account
- On
- update(bank_account)
- when
- bank_account.id Z
- do
- notify_by_email(Z)
Identify tokens, predicates!
9Key Concepts Expression Signatures
Expression Signature E1 bank_account.account.id
CONSTANT used in T1, T2, T3 E2 bank_accoun
t. balance lt CONSTANT used in T1, T2
- Triggers
- T1
- when bank_account.id X
- And bank_account.balance lt 10000
- And bank_account.id checking_account.id
- T2
- when bank_account.id Y
- And bank_account.balance lt 20000
- T3
- when bank_account.id Z
10Key Concepts Predicate Index Structure
Table of Trigger ID and
Corresponding constants
ES
token index
ES
ES
token index
token index
ES Expression Signature
11Predicate Index Structure Example
T1 when bank_account.id X And
bank_account.balance lt 10000 And bank_account.id
checking_account.id T2 when bank_account.id
Y And bank_account.balance lt 20000 T3 when
bank_account.id Z
T1 T2 T3
X Y Z
E1
bank_account index
E2
T1 T2
10000 20000
Hash(token)
checking_account index
E1 bank_account.account.id CONSTANT E2 bank_a
ccount. balance lt CONSTANT
12Trigger Processing
On(update(bank_account))
T1 ?
T2 ?
T3 ?
- Naïve Approach
- Test all triggers (conditions), one by one
13Trigger Processing
- e.g., bank_account.balance 15000
- And bank_account.id Y
- Only T2 will be fired
On an event, get all unique tokens from
corresponding triggers For each token t Hash
to the Expression Signature List (t) For each
element in Expression Signature List (t)
Add selection predicate that satisfies
condition End For End For Process join
predicates, if required Perform corresponding
action
14Concurrency
15Validation
- No validations provided in the paper
16Future Work
- Temporal trigger processing
- Trigger with aggregates
- New operators and data types
17Rewrite today
- Validations
- Execution Trace