7 Query Localization
7 Query Localization
• Introduction
• Background
• Distributed Database Design
• Database Integration
• Semantic Data Control
• Distributed Query Processing
➡ Overview
➡ Query decomposition and localization
➡ Distributed query optimization
• Multidatabase query processing
• Distributed Transaction Management
• Data Replication
• Parallel Database Systems
• Distributed Object DBMS
• Peer-to-Peer Data Management
• Web Data Management
• Current Issues
Distributed DBMS © M. T. Özsu & P. Valduriez
Ch.7/1
Step 1 – Query Decomposition
Input : Calculus query on global relations
• Normalization
➡ manipulate query quantifiers and qualification
• Analysis
➡ detect and reject “incorrect” queries
➡ possible for only a subset of relational calculus
• Simplification
➡ eliminate redundant predicates
• Restructuring
➡ calculus query algebraic query
➡ more than one translation is possible
➡ use transformation rules
ASG ASG
EMP.ENO=ASG.ENO ASG.PNO=PROJ.PNO EMP.ENO=ASG.ENO ASG.PNO=PROJ.PNO
TITLE =
EMP RESP PROJ EMP PROJ
“Programmer”
ENAME
RESULT
PNAME=“CAD/CAM”
ASG
ENAME
RESULT
PNAME=“CAD/CAM”
➡ Elimination of redundancy
✦ idempotency rules
p1 ¬( p1) false
p1 (p1 p2) p1
p1 false p1
…
➡ Application of transitivity
➡ Use of integrity rules
SELECT TITLE
FROM EMP
WHERE EMP.ENAME = "J. Doe"
⋈PNO,ENO
⋈PNO
PNO,ENAME
⋈ENO
SELECT ENAME
FROM EMP
ENAME ENAME
⋈ENO
TITLE=“Mech. Eng.”
⋈ENO ⋈ENO
TITLE=“Mech. Eng.”
ASG2 EMP2
Distributed DBMS © M. T. Özsu & P. Valduriez
Ch.7/25
Reduction for Hybrid
Fragmentation
• Combine the rules already specified:
➡ Remove empty relations generated by contradicting selections on horizontal
fragments;
➡ Remove useless relations generated by projections on vertical fragments;
➡ Distribute joins over unions in order to isolate and remove useless joins.