Presentation is loading. Please wait.

Presentation is loading. Please wait.

Distributed DBMSPage 7-9. 1© 1998 M. Tamer Özsu & Patrick Valduriez Outline Introduction Background Distributed DBMS Architecture Distributed Database.

Similar presentations


Presentation on theme: "Distributed DBMSPage 7-9. 1© 1998 M. Tamer Özsu & Patrick Valduriez Outline Introduction Background Distributed DBMS Architecture Distributed Database."— Presentation transcript:

1 Distributed DBMSPage 7-9. 1© 1998 M. Tamer Özsu & Patrick Valduriez Outline Introduction Background Distributed DBMS Architecture Distributed Database Design  Distributed Query Processing à Query Processing Methodology à Distributed Query Optimization Distributed Transaction Management (Extensive) n Building Distributed Database Systems (RAID) n Mobile Database Systems Privacy, Trust, and Authentication Peer to Peer Systems

2 Distributed DBMSPage 7-9. 2© 1998 M. Tamer Özsu & Patrick Valduriez Distributed Query Processing Methodology Calculus Query on Distributed Relations CONTROL SITE LOCAL SITES Query Decomposition Query Decomposition Data Localization Data Localization Algebraic Query on Distributed Relations Global Optimization Global Optimization Fragment Query Local Optimization Local Optimization Optimized Fragment Query with Communication Operations Optimized Local Queries GLOBAL SCHEMA GLOBAL SCHEMA FRAGMENT SCHEMA FRAGMENT SCHEMA STATS ON FRAGMENTS STATS ON FRAGMENTS LOCAL SCHEMAS LOCAL SCHEMAS

3 Distributed DBMSPage 7-9. 3© 1998 M. Tamer Özsu & Patrick Valduriez Convert relational calculus to relational algebra Make use of query trees Example Find the names of employees other than J. Doe who worked on the CAD/CAM project for either 1 or 2 years. SELECTENAME FROMEMP, ASG, PROJ WHEREEMP.ENO = ASG.ENO ANDASG.PNO = PROJ.PNO ANDENAME ≠ “J. Doe” ANDPNAME = “CAD/CAM” AND(DUR = 12 OR DUR = 24) Restructuring  ENAME  DUR=12 OR DUR=24  PNAME=“CAD/CAM”  ENAME≠“J. DOE” PROJASGEMP Project Select Join PNO ENO

4 Distributed DBMSPage 7-9. 4© 1998 M. Tamer Özsu & Patrick Valduriez Commutativity of binary operations  R  S  S  R  R S  S R  R  S  S  R Associativity of binary operations  ( R  S )  T  R  ( S  T )  ( R S ) T  R ( S T ) Idempotence of unary operations   A ’ (  A ’ (R))  A ’ (R)   p 1 ( A 1 ) (  p 2 ( A 2 ) ( R )) =  p 1 ( A 1 )  p 2 ( A 2 ) ( R ) where R [ A ] and A'  A, A"  A and A'  A" Commuting selection with projection Restructuring – Transformation Rules

5 Distributed DBMSPage 7-9. 5© 1998 M. Tamer Özsu & Patrick Valduriez Commuting selection with binary operations   p ( A ) ( R  S )  (  p ( A ) ( R ))  S   p ( A i ) ( R ( A j,B k ) S )  (  p ( A i ) ( R )) ( A j,B k ) S   p ( A i ) ( R  T )   p ( A i ) ( R )   p ( A i ) ( T ) where A i belongs to R and T Commuting projection with binary operations   C ( R  S )   A ’ ( R )   B ’ ( S )   C ( R ( A j,B k ) S )   A ’ ( R ) ( A j,B k )  B ’ ( S )   C ( R  S )   C ( R )   C ( S ) where R [ A ] and S [ B ]; C = A '  B ' where A'  A, B'  B Restructuring – Transformation Rules

6 Distributed DBMSPage 7-9. 6© 1998 M. Tamer Özsu & Patrick Valduriez Example Recall the previous example: Find the names of employees other than J. Doe who worked on the CAD/CAM project for either one or two years. SELECTENAME FROMPROJ, ASG, EMP WHEREASG.ENO=EMP.ENO ANDASG.PNO=PROJ.PNO ANDENAME≠“J. Doe” ANDPROJ.PNAME=“CAD/CAM” AND(DUR=12 OR DUR=24)  ENAME  DUR=12 OR DUR=24  PNAME=“CAD/CAM”  ENAME≠“J. DOE” PROJASGEMP Project Select Join PNO ENO

7 Distributed DBMSPage 7-9. 7© 1998 M. Tamer Özsu & Patrick Valduriez Equivalent Query  ENAME  PNAME=“CAD/CAM”  (DUR=12  DUR=24)  ENAME≠“J. DOE”  PROJASGEMP PNO  ENO

8 Distributed DBMSPage 7-9. 8© 1998 M. Tamer Özsu & Patrick Valduriez EMP  ENAME  ENAME ≠ "J. Doe" ASGPROJ  PNO,ENAME  PNAME = "CAD/CAM"  PNO  DUR =12  DUR=24  PNO,ENO  PNO,ENAME Restructuring PNO ENO

9 Distributed DBMSPage 7-9. 9© 1998 M. Tamer Özsu & Patrick Valduriez Total Time (or Total Cost) à Reduce each cost (in terms of time) component individually à Do as little of each cost component as possible à Optimizes the utilization of the resources Increases system throughput Response Time à Do as many things as possible in parallel à May increase total time because of increased total activity Cost Functions

10 Distributed DBMSPage 7-9. 10© 1998 M. Tamer Özsu & Patrick Valduriez Summation of all cost factors Total cost= CPU cost + I/O cost + communication cost CPU cost= unit instruction cost  no.of instructions I/O cost = unit disk I/O cost  no. of disk I/Os communication cost = message initiation + transmission Total Cost

11 Distributed DBMSPage 7-9. 11© 1998 M. Tamer Özsu & Patrick Valduriez Wide area network à message initiation and transmission costs high à local processing cost is low (fast mainframes or minicomputers) à ratio of communication to I/O costs = 20:1 Local area networks à communication and local processing costs are more or less equal à ratio = 1:1.6 Total Cost Factors

12 Distributed DBMSPage 7-9. 12© 1998 M. Tamer Özsu & Patrick Valduriez Elapsed time between the initiation and the completion of a query Response time= CPU time + I/O time + communication time CPU time= unit instruction time  no. of sequential instructions I/O time= unit I/O time  no. of sequential I/Os communication time = unit msg initiation time  no. of sequential msg + unit transmission time  no. of sequential bytes Response Time

13 Distributed DBMSPage 7-9. 13© 1998 M. Tamer Özsu & Patrick Valduriez Assume that only the communication cost is considered Total time = 2  message initialization time + unit transmission time  ( x+y ) Response time = max {time to send x from 1 to 3, time to send y from 2 to 3} time to send x from 1 to 3 = message initialization time + unit transmission time  x time to send y from 2 to 3 = message initialization time + unit transmission time  y Example Site 1Site 2 x units y units Site 3


Download ppt "Distributed DBMSPage 7-9. 1© 1998 M. Tamer Özsu & Patrick Valduriez Outline Introduction Background Distributed DBMS Architecture Distributed Database."

Similar presentations


Ads by Google