Distributed Database Management Systems

Slides:



Advertisements
Similar presentations
Distributed Database Management Systems Lecture 15.
Advertisements

Aliaksei A. HolubeuAdvances in Database Query Processing Universität Konstanz, 2005 Optimizing an SQL-like Nested Query.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 16 Relational Database Design Algorithms and Further Dependencies.
Distributed Database Systems
Outline  Introduction  Background  Distributed DBMS Architecture  Distributed Database Design  Semantic Data Control ➠ View Management ➠ Data Security.
CS CS4432: Database Systems II Logical Plan Rewriting.
Distributed DBMSPage 6. 1© 1998 M. Tamer Özsu & Patrick Valduriez Outline Introduction Background Distributed DBMS Architecture Distributed Database Design.
Distributed DBMSPage © 1998 M. Tamer Özsu & Patrick Valduriez Outline Introduction Background Distributed DBMS Architecture Distributed Database.
Distributed Query Processing –An Overview
Distributed DBMSPage © 1998 M. Tamer Özsu & Patrick Valduriez Outline Introduction Background Distributed DBMS Architecture Distributed Database.
Distributed DBMS© M. T. Özsu & P. Valduriez Ch.6/1 Outline Introduction Background Distributed Database Design Database Integration Semantic Data Control.
Distributed DBMS © M. T. Özsu & P. Valduriez Ch.7/1 Outline Introduction Background Distributed Database Design Database Integration Semantic Data Control.
Distributed Database Systems Dr. Mohamed Osman Hegazi.
Distributed DBMS© M. T. Özsu & P. Valduriez Ch.4/1 Outline Introduction Background Distributed Database Design Database Integration ➡ Schema Matching ➡
Distributed DBMSPage 4. 1© 1998 M. Tamer Özsu & Patrick Valduriez Outline Introduction Background  Distributed DBMS Architecture  Datalogical Architecture.
1 Distributed Databases Review CS347 June 6, 2001.
Lecture 5 on Query Optimization
Distributed DBMS© 2001 M. Tamer Özsu & Patrick Valduriez Page 1.1 Outline  Introduction à What is a distributed DBMS à Problems à Current state-of-affairs.
L Distributed Query Optimization Algorithms -- 1 Distributed Query Optimization Algorithms v System R and R* v Hill Climbing and SDD-1.
Distributed DBMSPage © 1998 M. Tamer Özsu & Patrick Valduriez Outline Introduction Background Distributed DBMS Architecture Distributed Database.
Distributed DBMS © M. T. Özsu & P. Valduriez Ch.7/1 Outline Introduction Background Distributed Database Design Database Integration Semantic Data Control.
CS 255: Database System Principles slides: From Parse Trees to Logical Query Plans By:- Arunesh Joshi Id:
Ch 6: ER to Relational Mapping
SQL - Part 2 Much of the material presented in these slides was developed by Dr. Ramon Lawrence at the University of Iowa.
low level data manipulation
DISTRIBUTED DATABASE DESIGN
CS 255: Database System Principles slides: From Parse Trees to Logical Query Plans By:- Arunesh Joshi Id:
Distributed DBMS Architecture
1 6. Distributed Query Optimization Chapter 9 Optimization of Distributed Queries.
Distributed DBMS © M. T. Özsu & P. Valduriez Ch.7/1 Οι διαφάνειες καλύπτουν μέρος των Κεφαλαίων 7&8: Distributed Database QueryProcessing and Optimization.
Query Optimization. Query Optimization Query Optimization The execution cost is expressed as weighted combination of I/O, CPU and communication cost.
PMIT-6102 Advanced Database Systems By- Jesmin Akhter Assistant Professor, IIT, Jahangirnagar University.
Overview of Query Processing
PMIT-6102 Advanced Database Systems By- Jesmin Akhter Assistant Professor, IIT, Jahangirnagar University.
PMIT-6102 Advanced Database Systems By- Jesmin Akhter Assistant Professor, IIT, Jahangirnagar University.
Query Processor  A query processor is a module in the DBMS that performs the tasks to process, to optimize, and to generate execution strategy for a high-level.
PMIT-6102 Advanced Database Systems By- Jesmin Akhter Assistant Professor, IIT, Jahangirnagar University.
Distributed DBMSPage © 1998 M. Tamer Özsu & Patrick Valduriez Outline Introduction Background Distributed DBMS Architecture Distributed Database.
Design Process - Where are we?
Software School of Hunan University Database Systems Design Part III : Mapping ER Diagram to Relational Schema.
PMIT-6101 Advanced Database Systems By- Jesmin Akhter Assistant Professor, IIT, Jahangirnagar University.
Query Processing – Query Trees. Evaluation of SQL Conceptual order of evaluation – Cartesian product of all tables in from clause – Rows not satisfying.
Relational Algebra p BIT DBMS II.
Chapter 17: Additional Slides February 6, Outline Physical Data Management  Fragments  Distributed Query Processing  Transactions Logical Data.
Chapter 18 Query Processing and Optimization. Chapter Outline u Introduction. u Using Heuristics in Query Optimization –Query Trees and Query Graphs –Transformation.
L4: Query Optimization (1) - 1 L4: Query Processing and Optimization v 4.1 Query Processing  Query Decomposition  Data Localization v 4.1 Query Optimization.
Distributed DBMS© 2001 M. Tamer Özsu & Patrick Valduriez Page 1.1 Outline n Introduction Background Distributed DBMS Architecture Distributed Database.
CS742 – Distributed & Parallel DBMSPage 3. 1M. Tamer Özsu Outline Introduction & architectural issues Data distribution  Distributed query processing.
Query Processing and Optimization, and Database Tuning
Outline Background Introduction Distributed DBMS Architecture
Introduction to the database systems (1)
Database Management System
DISTRIBUTED DATABASE ARCHITECTURE
Running Example – Airline
DATA ACCESS CONTROL, MANAGEMENT DATA AND SECURITY (CIB125) PERTEMUAN 6
ER Modeling Exercise Consider a set of courses, both at grad and undergrad level. Each course has at least one section. Each section is taught by only.
Outline Introduction Background Distributed DBMS Architecture
Outline Introduction Background Distributed DBMS Architecture
Outline Introduction Background Distributed DBMS Architecture
Example Schema: Employee (ENO, ENAME, TITLE)
Algebraic Laws.
Distributed Database Management Systems
Advance Database Systems
Distributed Database Management Systems
Distributed Database Management System
Distributed Database Design
Distributed Database Management Systems
Distributed Database Management Systems
Outline Introduction Background Distributed DBMS Architecture
Presentation transcript:

Distributed Database Management Systems Lecture 32

In the previous lecture Query Processing Query Decomposition Its Different Phases.

In this Lecture Final phase of QD Next phase of Query Optimization: Data Localization.

A1, ….,An(p(Ap)(R))  ((p(Ap) A1, ….,An, Ap(R)))- 3- Idempotency of unary Ops i) A’(A”(R))  A’(R) ii) σp1(A1)(σp2(A2)(R))  σp1(A1) ∧ p2(A2)(R)- 4- Commuting selection with projection A1, ….,An(p(Ap)(R))  ((p(Ap) A1, ….,An, Ap(R)))-

5- Commuting Selection with binary ops, like join and CP 6- Commuting Projection with binary ops, like join and CP

Many equivalence query trees can be generated Comparing all such trees to select best is not feasible Heuristic is applied

Separation of Unary Ops Unary ops on the same relation grouped together Unary ops commuted with binary ops Binary ops are ordered

ASN PROJ EMP x ⋈ pNo^eNo  (pName = ‘CAD/CAM’)^ (dur = 12 v dur = 24)^ eName ’Saleem’  eName

PROJ ASG EMP  pNo’  pNo, eNo  eNo, eName  pNo, eName  eName pName = ‘CAD/CAM’ dur=12 v dur = 24 eName != ‘Saleem’  pNo’  pNo, eNo  eNo, eName  pNo, eName  eName

This concludes Query Decomposition and Restructuring Concerns both centralized and distributed environments

Now we move to the second phase of Query Optimization; Data Localization of DD QD at global level, this phase transform into local ones (fragments)

Called Localization Program A Naïve rule… However, it won’t be an efficient one

Reduction During Data Localization

Example Schema EMP(eNo, eName, title) Horizontal Fragmentation EMP1 = eNo ≤ ‘E3’ (EMP) EMP2 = ’E3’<eNo ≤ ‘E6’ (EMP) EMP3 = eNo > ‘E6’ (EMP)

Reduction with Selection Rule 1: pi (Rj) = Ø if ∀x in Rj: (pi(x) ^ pj(x)) That is, there exist conflicting predicates

Select * from EMP where eNo = ‘E7’ U eNo = ‘E7’ EMP3 eNo = ‘E7’ Smart thinking Naïve Rule

Reduction on Join Distributing joins over unions and avoiding unnecessary joins (R1UR2) ⋈ R3= (R1 ⋈ R3) U (R2 ⋈ R3)

Rule2: Ri⋈Rj = Ø if ∀x in Ri and ∀y in Rj:(pi(x) ^ pj(x)) Useless joins can be determined viewing the join predicates

Remember! Reduced query is not always better. We have to be watchful- Parallel Execution ASG1 = eNo ≤ ‘E3’ (ASG) ASG2 = ’eNo > ‘E3’ (ASG).

Select eName From EMP, ASG Where EMP.eNo = ASG. eNo.

We already know about PHF of EMP ⋈eNo ASG1 ASG2 Generic Query

EMP1 U ⋈eNo ASG1 EMP2 ASG2 EMP3 Reduction for PHF with JOIN

Reduction for VF Relation fragmented on projection, with PK as the common attribute Localization involves natural join on PK

EMP1 = eNo, eName (EMP) EMP2 = eNo, title (EMP) Relation R defined over attributes A = {A1, ..., An} vertically fragmented as Ri = A' (R) where A'  A

Rule3: D,K(Ri) is useless if the set of projection attributes D is not in A‘.

Example: Select eName from EMP ⋈eNo Generic Query Reduced Query

Reduction for DF Relation R is fragmented based on the predicate on S DF should be done for hierarchical relationship between R and S-

Example ASG1: ASG ⋉ ENO EMP1 ASG2: ASG ⋉ ENO EMP2 EMP1: σ title= ‘Programmer’ (EMP) EMP2: σ title “Programmer’ (EMP).

Query SELECT * FROM EMP, ASG WHERE ASG.eNo = EMP.eNo AND EMP.title = "Mech. Eng."

ASG1 ⋈eNo U ASG2 EMP1 EMP2 title = ‘Mech Eng.’ Generic Query

Pushing Selection Down ASG1 ⋈eNo U ASG2 EMP2 title = ‘Mech Eng.’ Pushing Selection Down ⋈eNo

ASG1 ⋈eNo U EMP2 ASG2 title = ‘Mech Eng.’ Union Moved Up

⋈eNo ASG2 EMP2 title = ‘Mech Eng.’ Optimal Reduced Query

Thanks