SlideShare uma empresa Scribd logo
1 de 31
Baixar para ler offline
MYTHILI.K

 Distributed database
 Query processing
 Distributed query processing methodology
 Query decomposition
 Data localization
 Global query optimization
 Join ordering
 Semi join
 Local query optimization
Topics Covered

 Multiple, Logically interrelated Databases
distributed over a complete network.
Distributed Database

 Translating a high level query (relational calculus) in
a sequence of database operators (relational algebra
+ communication operators)
 One high level query can have many equivalent
transformations, the main difficulty is to select the
most efficient one
Query Processing

Example – Input
 All players called “Muller", who are playing for a
team
QUERY: SELECT p.Name
FROM Players p, Teams t
WHERE p.TID = t.TID
AND p.Name LIKE " Muller"
Contd..

QUERY: SELECT p.Name FROM Players p, Teams
t WHERE p.TID = t.TID
AND p.Name LIKE " Muller"
Solution 1 Solution 2

 The retrieval of data from different sites in a
network.
DISTRIBUTED QUERY
PROCESSING

Methodology

 Decomposing a high level query (relational calculus)
into an algebraic query (relational algebra) on global
relations
1. Query Decomposition

1) Normalization: Rewriting the query in a normalized form,
that is useful for further manipulations
2) Analysis: Query is analysed semantically so that incorrect
queries are detected and rejected
3) Elimination of redundancy: Simplifying query to
eliminate redundant predicates
4) Rewriting: The relational calculus query is translated in a
equivalent algebraic query
Steps of query
decomposition

 Conjunctive normal form
(p11∨p12∨…∨p1n) ∧…∧ (pm1∨pm2∨…∨pmn)
 Disjunctive normal form
(p11∧p12 ∧…∧p1n) ∨…∨ (pm1 ∧pm2∧…∧ pmn)
 OR's mapped into union
 AND's mapped into join or selection
Normalization

 Conjunctive Normal Form
(p.TID = t.TID) ∧ (p.Name =“Muller” ∨ p.Name
=“Kim”)
 Disjunctive Normal Form
((p.TID = t.TID) ∧ (p.Name =“Muller”)) ∨
((p.TID = t.TID) ∧ (p.Name =“Kim”))
SELECT p.Name FROM Players p, Teams t
WHERE p.TID = t.TID AND (p.Name LIKE " Muller“
OR p.Name LIKE “Kim”)

 Rejecting normalized queries for which further
processing is impossible or unnecessary
 Two main reasons for rejection:
1)Type incorrectness: Using a relation or an
attribute which is unknown in the global schema or
using wrong datatype for an operation
2)Semantical incorrectness: If the components of
a query do not contribute in any way to generate a
valid result
Analysis

Simplification
(removing redundancy)
SELECT DISTINCT f.Position
FROM Players p, Formation f
WHERE (NOT(f.Position =
striker")
AND (f.Position = "striker" OR
f.Position="keeper")
AND NOT(f.Position =
"keeper"))
OR (f.PID = p.PID
AND p.Name = "Thomas
Muller")
SELECT DISTINCT
f.Position
FROM Players p,
Formation f
WHERE f.PID = p.PID
AND p.Name = "Thomas
Muller"
SELECT p.Name, t.Name
FROM Players p, Team t,
Formation f
WHERE p.TID = t.TID
AND p.PID = f.PID
AND p.Active = 1
AND (t.Name = "FC Bayern
Munchen“ OR t.Name = "Borussia
Dortmund")
AND f.Position = "striker"
Rewriting
 Two Steps:
1. Transforming the
query into an algebraic
relational query tree.
2. Restructuring the
algebraic tree to improve
performance
 Ex:All active strikers of
"FC Bayern Munchen"
and "Borussia Dortmund"

1) Separating of unary operators (selection, projection)
2) Grouping unary operators on the same relation
3) Commuting unary operators with binary operators
4) Changing order of binary operators
How to improve a "bad-
algebraic-tree"?

Algebraic Tree

 Input: Algebraic query on distributed relations
 Purpose:
∗ Apply data distribution information to the
algebra operations and determine which fragments are
involved
∗ Substitute global query with queries on
fragments
∗ Optimize the global query
2. Data Localization

Query:
SELECT * FROM EMP, ASG WHERE
EMP.ENO=ASG.ENO
Horizontal fragmentation:
∗ EMP1 = σ(ENO ≤ ” E3”(EMP))
∗ EMP2 = σ (” E3” ≤ENO>” E6”(EMP))
∗ EMP3 = σENO> ” E6”(EMP)
∗ ASG1 = σENO ≤ ” E3”(ASG)
∗ ASG2 = σENO> ” E3”(ASG)
Horizontal
Fragmentation

Contd..
Generic Query Reduced Query

Query:
SELECT ENAME FROM EMP
Fragmentation:
∗ EMP1 = ΠENO,ENAME (EMP )
∗ EMP2 = ΠENO,TITLE (EMP )
Vertical Fragmentation

SELECT ENAME FROM EMP
Generic Query Reduced Query

 Input: Fragment query
 Find the best (not necessarily optimal) global
schedule
➠ Minimize a cost function
➠ Distributed join processing
Which relation to ship where?
Ship-whole vs. ship-as-needed
➠ Decide on the use of semi joins
3. Global Query
Optimization

Example relations: Employee at site 1 and
Department at Site 2
Employee at site 1. 10,000 rows. Row size = 100 bytes.
Table size = 106 bytes.
Department at Site 2. 100 rows. Row size = 35 bytes.
Table size = 3,500 bytes.
Q: For each employee, retrieve employee name
and department name Where the employee
works.
Q: Fname,Lname,Dname (Employee Dno = Dnumber
Department)
Join Ordering

 Strategies:
1. Transfer Employee and Department to site 3.
 Total transfer bytes = 1,000,000 + 3500 = 1,003,500 bytes.
2. Transfer Employee to site 2, execute join at site 2 and
send the result to site 3.
 Query result size = 40 * 10,000 = 400,000 bytes. Total
transfer size = 400,000 + 1,000,000 = 1,400,000 bytes.
3. Transfer Department relation to site 1, execute the join
at site 1, and send the result to site 3.
 Total bytes transferred = 400,000 + 3500 = 403,500 bytes.
Contd..

 It is used to reduce the data transmission cost.
Computing steps:
1) Project Ri on attribute A (Ri[A] ) and
ship this projection ( a semijoin
projection) from the site of Ri to the site
of Rj ;
2) Reduce Rj to Rj’ by eliminating tuples
where attribute A are not matching any
value in Ri[A] .
Semijoin Rj⋉ Ri

Contd..
3
4
5
7
8
9
A C
R2
A B
1
2
4
5
3 6
R1
Site 1
Site 2
1
2
3
R1[A]
projection
Ship(3)
qs
Ship(2)
Ship(6)
3 7
R2’
reduc
e

1. Project the join attributes of Department at site 2, and
transfer them to site 1. For Q, 4 * 100 = 400 bytes are
transferred
2. Join the transferred file with the Employee relation at
site 1, and transfer the required attributes from the
resulting file to site 2. For Q, 34 * 10,000 = 340,000
bytes are transferred.
3. Execute the query by joining the transferred file with
Department and present the result to the user at site
2.
 Using this strategy, we transfer 340,400 bytes for Q.
Contd..

 Input: Best global execution schedule
• Use the centralized optimization
techniques
4. Local Optimization

 R. Elmasri, S.B. Navathe, “Fundamentals of Database
Systems”, Fifth Edition,Pearson Education/Addison
Wesley, 2007.
 Henry F Korth, Abraham Silberschatz, S.
Sudharshan, “Database System Concepts”, Fifth
Edition, McGraw Hill, 2006.
References
THANK YOU
.

Mais conteúdo relacionado

Mais procurados

Distributed Database Management System
Distributed Database Management SystemDistributed Database Management System
Distributed Database Management SystemAAKANKSHA JAIN
 
Query processing in Distributed Database System
Query processing in Distributed Database SystemQuery processing in Distributed Database System
Query processing in Distributed Database SystemMeghaj Mallick
 
Distributed DBMS - Unit 8 - Distributed Transaction Management & Concurrency ...
Distributed DBMS - Unit 8 - Distributed Transaction Management & Concurrency ...Distributed DBMS - Unit 8 - Distributed Transaction Management & Concurrency ...
Distributed DBMS - Unit 8 - Distributed Transaction Management & Concurrency ...Gyanmanjari Institute Of Technology
 
Transactions and Concurrency Control
Transactions and Concurrency ControlTransactions and Concurrency Control
Transactions and Concurrency ControlDilum Bandara
 
Introduction to Distributed System
Introduction to Distributed SystemIntroduction to Distributed System
Introduction to Distributed SystemSunita Sahu
 
Distributed dbms architectures
Distributed dbms architecturesDistributed dbms architectures
Distributed dbms architecturesPooja Dixit
 
Distributed concurrency control
Distributed concurrency controlDistributed concurrency control
Distributed concurrency controlBinte fatima
 
Database , 8 Query Optimization
Database , 8 Query OptimizationDatabase , 8 Query Optimization
Database , 8 Query OptimizationAli Usman
 
DISTRIBUTED DATABASE WITH RECOVERY TECHNIQUES
DISTRIBUTED DATABASE WITH RECOVERY TECHNIQUESDISTRIBUTED DATABASE WITH RECOVERY TECHNIQUES
DISTRIBUTED DATABASE WITH RECOVERY TECHNIQUESAAKANKSHA JAIN
 
Naming in Distributed Systems
Naming in Distributed SystemsNaming in Distributed Systems
Naming in Distributed SystemsNandakumar P
 
DATA WAREHOUSE IMPLEMENTATION BY SAIKIRAN PANJALA
DATA WAREHOUSE IMPLEMENTATION BY SAIKIRAN PANJALADATA WAREHOUSE IMPLEMENTATION BY SAIKIRAN PANJALA
DATA WAREHOUSE IMPLEMENTATION BY SAIKIRAN PANJALASaikiran Panjala
 
Transaction states and properties
Transaction states and propertiesTransaction states and properties
Transaction states and propertiesChetan Mahawar
 
Replication Techniques for Distributed Database Design
Replication Techniques for Distributed Database DesignReplication Techniques for Distributed Database Design
Replication Techniques for Distributed Database DesignMeghaj Mallick
 
Distributed database management system
Distributed database management  systemDistributed database management  system
Distributed database management systemPooja Dixit
 

Mais procurados (20)

Distributed Database Management System
Distributed Database Management SystemDistributed Database Management System
Distributed Database Management System
 
Query processing in Distributed Database System
Query processing in Distributed Database SystemQuery processing in Distributed Database System
Query processing in Distributed Database System
 
Distributed DBMS - Unit 8 - Distributed Transaction Management & Concurrency ...
Distributed DBMS - Unit 8 - Distributed Transaction Management & Concurrency ...Distributed DBMS - Unit 8 - Distributed Transaction Management & Concurrency ...
Distributed DBMS - Unit 8 - Distributed Transaction Management & Concurrency ...
 
DDBMS Paper with Solution
DDBMS Paper with SolutionDDBMS Paper with Solution
DDBMS Paper with Solution
 
Distributed DBMS - Unit 6 - Query Processing
Distributed DBMS - Unit 6 - Query ProcessingDistributed DBMS - Unit 6 - Query Processing
Distributed DBMS - Unit 6 - Query Processing
 
Transactions and Concurrency Control
Transactions and Concurrency ControlTransactions and Concurrency Control
Transactions and Concurrency Control
 
Distributed Transaction
Distributed TransactionDistributed Transaction
Distributed Transaction
 
Introduction to Distributed System
Introduction to Distributed SystemIntroduction to Distributed System
Introduction to Distributed System
 
Distributed dbms architectures
Distributed dbms architecturesDistributed dbms architectures
Distributed dbms architectures
 
Distributed concurrency control
Distributed concurrency controlDistributed concurrency control
Distributed concurrency control
 
Ddbms1
Ddbms1Ddbms1
Ddbms1
 
Database , 8 Query Optimization
Database , 8 Query OptimizationDatabase , 8 Query Optimization
Database , 8 Query Optimization
 
DISTRIBUTED DATABASE WITH RECOVERY TECHNIQUES
DISTRIBUTED DATABASE WITH RECOVERY TECHNIQUESDISTRIBUTED DATABASE WITH RECOVERY TECHNIQUES
DISTRIBUTED DATABASE WITH RECOVERY TECHNIQUES
 
Rule based system
Rule based systemRule based system
Rule based system
 
Naming in Distributed Systems
Naming in Distributed SystemsNaming in Distributed Systems
Naming in Distributed Systems
 
DATA WAREHOUSE IMPLEMENTATION BY SAIKIRAN PANJALA
DATA WAREHOUSE IMPLEMENTATION BY SAIKIRAN PANJALADATA WAREHOUSE IMPLEMENTATION BY SAIKIRAN PANJALA
DATA WAREHOUSE IMPLEMENTATION BY SAIKIRAN PANJALA
 
Transaction states and properties
Transaction states and propertiesTransaction states and properties
Transaction states and properties
 
Replication Techniques for Distributed Database Design
Replication Techniques for Distributed Database DesignReplication Techniques for Distributed Database Design
Replication Techniques for Distributed Database Design
 
Distributed database management system
Distributed database management  systemDistributed database management  system
Distributed database management system
 
Distributed DBMS - Unit 1 - Introduction
Distributed DBMS - Unit 1 - IntroductionDistributed DBMS - Unit 1 - Introduction
Distributed DBMS - Unit 1 - Introduction
 

Semelhante a Distributed Query Processing

Terraform at Scale - All Day DevOps 2017
Terraform at Scale - All Day DevOps 2017Terraform at Scale - All Day DevOps 2017
Terraform at Scale - All Day DevOps 2017Jonathon Brouse
 
Everyday I'm Shuffling - Tips for Writing Better Spark Programs, Strata San J...
Everyday I'm Shuffling - Tips for Writing Better Spark Programs, Strata San J...Everyday I'm Shuffling - Tips for Writing Better Spark Programs, Strata San J...
Everyday I'm Shuffling - Tips for Writing Better Spark Programs, Strata San J...Databricks
 
Lecture#6 functions in c++
Lecture#6 functions in c++Lecture#6 functions in c++
Lecture#6 functions in c++NUST Stuff
 
R getting spatial
R getting spatialR getting spatial
R getting spatialFAO
 
Grouping & Summarizing Data in R
Grouping & Summarizing Data in RGrouping & Summarizing Data in R
Grouping & Summarizing Data in RJeffrey Breen
 
Outrageous Ideas for Graph Databases
Outrageous Ideas for Graph DatabasesOutrageous Ideas for Graph Databases
Outrageous Ideas for Graph DatabasesMax De Marzi
 
Spark + Clojure for Topic Discovery - Zalando Tech Clojure/Conj Talk
Spark + Clojure for Topic Discovery - Zalando Tech Clojure/Conj TalkSpark + Clojure for Topic Discovery - Zalando Tech Clojure/Conj Talk
Spark + Clojure for Topic Discovery - Zalando Tech Clojure/Conj TalkZalando Technology
 
Gossip-based resource allocation for green computing in large clouds
Gossip-based resource allocation for green computing in large cloudsGossip-based resource allocation for green computing in large clouds
Gossip-based resource allocation for green computing in large cloudsRerngvit Yanggratoke
 
R programming & Machine Learning
R programming & Machine LearningR programming & Machine Learning
R programming & Machine LearningAmanBhalla14
 
Guaranteeing Consensus in Distriubuted Systems with CRDTs
Guaranteeing Consensus in Distriubuted Systems with CRDTsGuaranteeing Consensus in Distriubuted Systems with CRDTs
Guaranteeing Consensus in Distriubuted Systems with CRDTsSun-Li Beatteay
 
cpphtp4_PPT_03.ppt
cpphtp4_PPT_03.pptcpphtp4_PPT_03.ppt
cpphtp4_PPT_03.pptSuleman Khan
 
Pumps, Compressors and Turbine Fault Frequency Analysis
Pumps, Compressors and Turbine Fault Frequency AnalysisPumps, Compressors and Turbine Fault Frequency Analysis
Pumps, Compressors and Turbine Fault Frequency AnalysisUniversity of Illinois,Chicago
 
Pumps, Compressors and Turbine Fault Frequency Analysis
Pumps, Compressors and Turbine Fault Frequency AnalysisPumps, Compressors and Turbine Fault Frequency Analysis
Pumps, Compressors and Turbine Fault Frequency AnalysisUniversity of Illinois,Chicago
 

Semelhante a Distributed Query Processing (20)

Query processing
Query processingQuery processing
Query processing
 
Terraform at Scale - All Day DevOps 2017
Terraform at Scale - All Day DevOps 2017Terraform at Scale - All Day DevOps 2017
Terraform at Scale - All Day DevOps 2017
 
Everyday I'm Shuffling - Tips for Writing Better Spark Programs, Strata San J...
Everyday I'm Shuffling - Tips for Writing Better Spark Programs, Strata San J...Everyday I'm Shuffling - Tips for Writing Better Spark Programs, Strata San J...
Everyday I'm Shuffling - Tips for Writing Better Spark Programs, Strata San J...
 
Lecture#6 functions in c++
Lecture#6 functions in c++Lecture#6 functions in c++
Lecture#6 functions in c++
 
R getting spatial
R getting spatialR getting spatial
R getting spatial
 
Grouping & Summarizing Data in R
Grouping & Summarizing Data in RGrouping & Summarizing Data in R
Grouping & Summarizing Data in R
 
10. R getting spatial
10.  R getting spatial10.  R getting spatial
10. R getting spatial
 
Computational Assignment Help
Computational Assignment HelpComputational Assignment Help
Computational Assignment Help
 
L7 pointers
L7 pointersL7 pointers
L7 pointers
 
Outrageous Ideas for Graph Databases
Outrageous Ideas for Graph DatabasesOutrageous Ideas for Graph Databases
Outrageous Ideas for Graph Databases
 
Spark + Clojure for Topic Discovery - Zalando Tech Clojure/Conj Talk
Spark + Clojure for Topic Discovery - Zalando Tech Clojure/Conj TalkSpark + Clojure for Topic Discovery - Zalando Tech Clojure/Conj Talk
Spark + Clojure for Topic Discovery - Zalando Tech Clojure/Conj Talk
 
Gossip-based resource allocation for green computing in large clouds
Gossip-based resource allocation for green computing in large cloudsGossip-based resource allocation for green computing in large clouds
Gossip-based resource allocation for green computing in large clouds
 
Clojure basics
Clojure basicsClojure basics
Clojure basics
 
R programming & Machine Learning
R programming & Machine LearningR programming & Machine Learning
R programming & Machine Learning
 
Pydata talk
Pydata talkPydata talk
Pydata talk
 
Guaranteeing Consensus in Distriubuted Systems with CRDTs
Guaranteeing Consensus in Distriubuted Systems with CRDTsGuaranteeing Consensus in Distriubuted Systems with CRDTs
Guaranteeing Consensus in Distriubuted Systems with CRDTs
 
cpphtp4_PPT_03.ppt
cpphtp4_PPT_03.pptcpphtp4_PPT_03.ppt
cpphtp4_PPT_03.ppt
 
Skyline queries
Skyline queriesSkyline queries
Skyline queries
 
Pumps, Compressors and Turbine Fault Frequency Analysis
Pumps, Compressors and Turbine Fault Frequency AnalysisPumps, Compressors and Turbine Fault Frequency Analysis
Pumps, Compressors and Turbine Fault Frequency Analysis
 
Pumps, Compressors and Turbine Fault Frequency Analysis
Pumps, Compressors and Turbine Fault Frequency AnalysisPumps, Compressors and Turbine Fault Frequency Analysis
Pumps, Compressors and Turbine Fault Frequency Analysis
 

Último

ClimART Action | eTwinning Project
ClimART Action    |    eTwinning ProjectClimART Action    |    eTwinning Project
ClimART Action | eTwinning Projectjordimapav
 
The role of Geography in climate education: science and active citizenship
The role of Geography in climate education: science and active citizenshipThe role of Geography in climate education: science and active citizenship
The role of Geography in climate education: science and active citizenshipKarl Donert
 
6 ways Samsung’s Interactive Display powered by Android changes the classroom
6 ways Samsung’s Interactive Display powered by Android changes the classroom6 ways Samsung’s Interactive Display powered by Android changes the classroom
6 ways Samsung’s Interactive Display powered by Android changes the classroomSamsung Business USA
 
Scientific Writing :Research Discourse
Scientific  Writing :Research  DiscourseScientific  Writing :Research  Discourse
Scientific Writing :Research DiscourseAnita GoswamiGiri
 
Comparative Literature in India by Amiya dev.pptx
Comparative Literature in India by Amiya dev.pptxComparative Literature in India by Amiya dev.pptx
Comparative Literature in India by Amiya dev.pptxAvaniJani1
 
BÀI TẬP BỔ TRỢ TIẾNG ANH 11 THEO ĐƠN VỊ BÀI HỌC - CẢ NĂM - CÓ FILE NGHE (GLOB...
BÀI TẬP BỔ TRỢ TIẾNG ANH 11 THEO ĐƠN VỊ BÀI HỌC - CẢ NĂM - CÓ FILE NGHE (GLOB...BÀI TẬP BỔ TRỢ TIẾNG ANH 11 THEO ĐƠN VỊ BÀI HỌC - CẢ NĂM - CÓ FILE NGHE (GLOB...
BÀI TẬP BỔ TRỢ TIẾNG ANH 11 THEO ĐƠN VỊ BÀI HỌC - CẢ NĂM - CÓ FILE NGHE (GLOB...Nguyen Thanh Tu Collection
 
Congestive Cardiac Failure..presentation
Congestive Cardiac Failure..presentationCongestive Cardiac Failure..presentation
Congestive Cardiac Failure..presentationdeepaannamalai16
 
Q-Factor HISPOL Quiz-6th April 2024, Quiz Club NITW
Q-Factor HISPOL Quiz-6th April 2024, Quiz Club NITWQ-Factor HISPOL Quiz-6th April 2024, Quiz Club NITW
Q-Factor HISPOL Quiz-6th April 2024, Quiz Club NITWQuiz Club NITW
 
31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...
31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...
31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...Nguyen Thanh Tu Collection
 
Man or Manufactured_ Redefining Humanity Through Biopunk Narratives.pptx
Man or Manufactured_ Redefining Humanity Through Biopunk Narratives.pptxMan or Manufactured_ Redefining Humanity Through Biopunk Narratives.pptx
Man or Manufactured_ Redefining Humanity Through Biopunk Narratives.pptxDhatriParmar
 
CLASSIFICATION OF ANTI - CANCER DRUGS.pptx
CLASSIFICATION OF ANTI - CANCER DRUGS.pptxCLASSIFICATION OF ANTI - CANCER DRUGS.pptx
CLASSIFICATION OF ANTI - CANCER DRUGS.pptxAnupam32727
 
PART 1 - CHAPTER 1 - CELL THE FUNDAMENTAL UNIT OF LIFE
PART 1 - CHAPTER 1 - CELL THE FUNDAMENTAL UNIT OF LIFEPART 1 - CHAPTER 1 - CELL THE FUNDAMENTAL UNIT OF LIFE
PART 1 - CHAPTER 1 - CELL THE FUNDAMENTAL UNIT OF LIFEMISSRITIMABIOLOGYEXP
 
Sulphonamides, mechanisms and their uses
Sulphonamides, mechanisms and their usesSulphonamides, mechanisms and their uses
Sulphonamides, mechanisms and their usesVijayaLaxmi84
 
Blowin' in the Wind of Caste_ Bob Dylan's Song as a Catalyst for Social Justi...
Blowin' in the Wind of Caste_ Bob Dylan's Song as a Catalyst for Social Justi...Blowin' in the Wind of Caste_ Bob Dylan's Song as a Catalyst for Social Justi...
Blowin' in the Wind of Caste_ Bob Dylan's Song as a Catalyst for Social Justi...DhatriParmar
 
MS4 level being good citizen -imperative- (1) (1).pdf
MS4 level   being good citizen -imperative- (1) (1).pdfMS4 level   being good citizen -imperative- (1) (1).pdf
MS4 level being good citizen -imperative- (1) (1).pdfMr Bounab Samir
 
Shark introduction Morphology and its behaviour characteristics
Shark introduction Morphology and its behaviour characteristicsShark introduction Morphology and its behaviour characteristics
Shark introduction Morphology and its behaviour characteristicsArubSultan
 
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 - I-LEARN SMART WORLD - CẢ NĂM - CÓ FILE NGHE (BẢN...
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 - I-LEARN SMART WORLD - CẢ NĂM - CÓ FILE NGHE (BẢN...BÀI TẬP BỔ TRỢ TIẾNG ANH 8 - I-LEARN SMART WORLD - CẢ NĂM - CÓ FILE NGHE (BẢN...
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 - I-LEARN SMART WORLD - CẢ NĂM - CÓ FILE NGHE (BẢN...Nguyen Thanh Tu Collection
 

Último (20)

ClimART Action | eTwinning Project
ClimART Action    |    eTwinning ProjectClimART Action    |    eTwinning Project
ClimART Action | eTwinning Project
 
The role of Geography in climate education: science and active citizenship
The role of Geography in climate education: science and active citizenshipThe role of Geography in climate education: science and active citizenship
The role of Geography in climate education: science and active citizenship
 
6 ways Samsung’s Interactive Display powered by Android changes the classroom
6 ways Samsung’s Interactive Display powered by Android changes the classroom6 ways Samsung’s Interactive Display powered by Android changes the classroom
6 ways Samsung’s Interactive Display powered by Android changes the classroom
 
prashanth updated resume 2024 for Teaching Profession
prashanth updated resume 2024 for Teaching Professionprashanth updated resume 2024 for Teaching Profession
prashanth updated resume 2024 for Teaching Profession
 
Scientific Writing :Research Discourse
Scientific  Writing :Research  DiscourseScientific  Writing :Research  Discourse
Scientific Writing :Research Discourse
 
Comparative Literature in India by Amiya dev.pptx
Comparative Literature in India by Amiya dev.pptxComparative Literature in India by Amiya dev.pptx
Comparative Literature in India by Amiya dev.pptx
 
BÀI TẬP BỔ TRỢ TIẾNG ANH 11 THEO ĐƠN VỊ BÀI HỌC - CẢ NĂM - CÓ FILE NGHE (GLOB...
BÀI TẬP BỔ TRỢ TIẾNG ANH 11 THEO ĐƠN VỊ BÀI HỌC - CẢ NĂM - CÓ FILE NGHE (GLOB...BÀI TẬP BỔ TRỢ TIẾNG ANH 11 THEO ĐƠN VỊ BÀI HỌC - CẢ NĂM - CÓ FILE NGHE (GLOB...
BÀI TẬP BỔ TRỢ TIẾNG ANH 11 THEO ĐƠN VỊ BÀI HỌC - CẢ NĂM - CÓ FILE NGHE (GLOB...
 
Congestive Cardiac Failure..presentation
Congestive Cardiac Failure..presentationCongestive Cardiac Failure..presentation
Congestive Cardiac Failure..presentation
 
Q-Factor HISPOL Quiz-6th April 2024, Quiz Club NITW
Q-Factor HISPOL Quiz-6th April 2024, Quiz Club NITWQ-Factor HISPOL Quiz-6th April 2024, Quiz Club NITW
Q-Factor HISPOL Quiz-6th April 2024, Quiz Club NITW
 
31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...
31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...
31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...
 
Man or Manufactured_ Redefining Humanity Through Biopunk Narratives.pptx
Man or Manufactured_ Redefining Humanity Through Biopunk Narratives.pptxMan or Manufactured_ Redefining Humanity Through Biopunk Narratives.pptx
Man or Manufactured_ Redefining Humanity Through Biopunk Narratives.pptx
 
CLASSIFICATION OF ANTI - CANCER DRUGS.pptx
CLASSIFICATION OF ANTI - CANCER DRUGS.pptxCLASSIFICATION OF ANTI - CANCER DRUGS.pptx
CLASSIFICATION OF ANTI - CANCER DRUGS.pptx
 
Spearman's correlation,Formula,Advantages,
Spearman's correlation,Formula,Advantages,Spearman's correlation,Formula,Advantages,
Spearman's correlation,Formula,Advantages,
 
PART 1 - CHAPTER 1 - CELL THE FUNDAMENTAL UNIT OF LIFE
PART 1 - CHAPTER 1 - CELL THE FUNDAMENTAL UNIT OF LIFEPART 1 - CHAPTER 1 - CELL THE FUNDAMENTAL UNIT OF LIFE
PART 1 - CHAPTER 1 - CELL THE FUNDAMENTAL UNIT OF LIFE
 
Sulphonamides, mechanisms and their uses
Sulphonamides, mechanisms and their usesSulphonamides, mechanisms and their uses
Sulphonamides, mechanisms and their uses
 
Blowin' in the Wind of Caste_ Bob Dylan's Song as a Catalyst for Social Justi...
Blowin' in the Wind of Caste_ Bob Dylan's Song as a Catalyst for Social Justi...Blowin' in the Wind of Caste_ Bob Dylan's Song as a Catalyst for Social Justi...
Blowin' in the Wind of Caste_ Bob Dylan's Song as a Catalyst for Social Justi...
 
MS4 level being good citizen -imperative- (1) (1).pdf
MS4 level   being good citizen -imperative- (1) (1).pdfMS4 level   being good citizen -imperative- (1) (1).pdf
MS4 level being good citizen -imperative- (1) (1).pdf
 
Introduction to Research ,Need for research, Need for design of Experiments, ...
Introduction to Research ,Need for research, Need for design of Experiments, ...Introduction to Research ,Need for research, Need for design of Experiments, ...
Introduction to Research ,Need for research, Need for design of Experiments, ...
 
Shark introduction Morphology and its behaviour characteristics
Shark introduction Morphology and its behaviour characteristicsShark introduction Morphology and its behaviour characteristics
Shark introduction Morphology and its behaviour characteristics
 
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 - I-LEARN SMART WORLD - CẢ NĂM - CÓ FILE NGHE (BẢN...
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 - I-LEARN SMART WORLD - CẢ NĂM - CÓ FILE NGHE (BẢN...BÀI TẬP BỔ TRỢ TIẾNG ANH 8 - I-LEARN SMART WORLD - CẢ NĂM - CÓ FILE NGHE (BẢN...
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 - I-LEARN SMART WORLD - CẢ NĂM - CÓ FILE NGHE (BẢN...
 

Distributed Query Processing

  • 2.   Distributed database  Query processing  Distributed query processing methodology  Query decomposition  Data localization  Global query optimization  Join ordering  Semi join  Local query optimization Topics Covered
  • 3.   Multiple, Logically interrelated Databases distributed over a complete network. Distributed Database
  • 4.   Translating a high level query (relational calculus) in a sequence of database operators (relational algebra + communication operators)  One high level query can have many equivalent transformations, the main difficulty is to select the most efficient one Query Processing
  • 5.  Example – Input  All players called “Muller", who are playing for a team QUERY: SELECT p.Name FROM Players p, Teams t WHERE p.TID = t.TID AND p.Name LIKE " Muller" Contd..
  • 6.  QUERY: SELECT p.Name FROM Players p, Teams t WHERE p.TID = t.TID AND p.Name LIKE " Muller" Solution 1 Solution 2
  • 7.   The retrieval of data from different sites in a network. DISTRIBUTED QUERY PROCESSING
  • 9.   Decomposing a high level query (relational calculus) into an algebraic query (relational algebra) on global relations 1. Query Decomposition
  • 10.  1) Normalization: Rewriting the query in a normalized form, that is useful for further manipulations 2) Analysis: Query is analysed semantically so that incorrect queries are detected and rejected 3) Elimination of redundancy: Simplifying query to eliminate redundant predicates 4) Rewriting: The relational calculus query is translated in a equivalent algebraic query Steps of query decomposition
  • 11.   Conjunctive normal form (p11∨p12∨…∨p1n) ∧…∧ (pm1∨pm2∨…∨pmn)  Disjunctive normal form (p11∧p12 ∧…∧p1n) ∨…∨ (pm1 ∧pm2∧…∧ pmn)  OR's mapped into union  AND's mapped into join or selection Normalization
  • 12.   Conjunctive Normal Form (p.TID = t.TID) ∧ (p.Name =“Muller” ∨ p.Name =“Kim”)  Disjunctive Normal Form ((p.TID = t.TID) ∧ (p.Name =“Muller”)) ∨ ((p.TID = t.TID) ∧ (p.Name =“Kim”)) SELECT p.Name FROM Players p, Teams t WHERE p.TID = t.TID AND (p.Name LIKE " Muller“ OR p.Name LIKE “Kim”)
  • 13.   Rejecting normalized queries for which further processing is impossible or unnecessary  Two main reasons for rejection: 1)Type incorrectness: Using a relation or an attribute which is unknown in the global schema or using wrong datatype for an operation 2)Semantical incorrectness: If the components of a query do not contribute in any way to generate a valid result Analysis
  • 14.  Simplification (removing redundancy) SELECT DISTINCT f.Position FROM Players p, Formation f WHERE (NOT(f.Position = striker") AND (f.Position = "striker" OR f.Position="keeper") AND NOT(f.Position = "keeper")) OR (f.PID = p.PID AND p.Name = "Thomas Muller") SELECT DISTINCT f.Position FROM Players p, Formation f WHERE f.PID = p.PID AND p.Name = "Thomas Muller"
  • 15. SELECT p.Name, t.Name FROM Players p, Team t, Formation f WHERE p.TID = t.TID AND p.PID = f.PID AND p.Active = 1 AND (t.Name = "FC Bayern Munchen“ OR t.Name = "Borussia Dortmund") AND f.Position = "striker" Rewriting  Two Steps: 1. Transforming the query into an algebraic relational query tree. 2. Restructuring the algebraic tree to improve performance  Ex:All active strikers of "FC Bayern Munchen" and "Borussia Dortmund"
  • 16.  1) Separating of unary operators (selection, projection) 2) Grouping unary operators on the same relation 3) Commuting unary operators with binary operators 4) Changing order of binary operators How to improve a "bad- algebraic-tree"?
  • 18.   Input: Algebraic query on distributed relations  Purpose: ∗ Apply data distribution information to the algebra operations and determine which fragments are involved ∗ Substitute global query with queries on fragments ∗ Optimize the global query 2. Data Localization
  • 19.  Query: SELECT * FROM EMP, ASG WHERE EMP.ENO=ASG.ENO Horizontal fragmentation: ∗ EMP1 = σ(ENO ≤ ” E3”(EMP)) ∗ EMP2 = σ (” E3” ≤ENO>” E6”(EMP)) ∗ EMP3 = σENO> ” E6”(EMP) ∗ ASG1 = σENO ≤ ” E3”(ASG) ∗ ASG2 = σENO> ” E3”(ASG) Horizontal Fragmentation
  • 21.  Query: SELECT ENAME FROM EMP Fragmentation: ∗ EMP1 = ΠENO,ENAME (EMP ) ∗ EMP2 = ΠENO,TITLE (EMP ) Vertical Fragmentation
  • 22.  SELECT ENAME FROM EMP Generic Query Reduced Query
  • 23.   Input: Fragment query  Find the best (not necessarily optimal) global schedule ➠ Minimize a cost function ➠ Distributed join processing Which relation to ship where? Ship-whole vs. ship-as-needed ➠ Decide on the use of semi joins 3. Global Query Optimization
  • 24.  Example relations: Employee at site 1 and Department at Site 2 Employee at site 1. 10,000 rows. Row size = 100 bytes. Table size = 106 bytes. Department at Site 2. 100 rows. Row size = 35 bytes. Table size = 3,500 bytes. Q: For each employee, retrieve employee name and department name Where the employee works. Q: Fname,Lname,Dname (Employee Dno = Dnumber Department) Join Ordering
  • 25.   Strategies: 1. Transfer Employee and Department to site 3.  Total transfer bytes = 1,000,000 + 3500 = 1,003,500 bytes. 2. Transfer Employee to site 2, execute join at site 2 and send the result to site 3.  Query result size = 40 * 10,000 = 400,000 bytes. Total transfer size = 400,000 + 1,000,000 = 1,400,000 bytes. 3. Transfer Department relation to site 1, execute the join at site 1, and send the result to site 3.  Total bytes transferred = 400,000 + 3500 = 403,500 bytes. Contd..
  • 26.   It is used to reduce the data transmission cost. Computing steps: 1) Project Ri on attribute A (Ri[A] ) and ship this projection ( a semijoin projection) from the site of Ri to the site of Rj ; 2) Reduce Rj to Rj’ by eliminating tuples where attribute A are not matching any value in Ri[A] . Semijoin Rj⋉ Ri
  • 27.  Contd.. 3 4 5 7 8 9 A C R2 A B 1 2 4 5 3 6 R1 Site 1 Site 2 1 2 3 R1[A] projection Ship(3) qs Ship(2) Ship(6) 3 7 R2’ reduc e
  • 28.  1. Project the join attributes of Department at site 2, and transfer them to site 1. For Q, 4 * 100 = 400 bytes are transferred 2. Join the transferred file with the Employee relation at site 1, and transfer the required attributes from the resulting file to site 2. For Q, 34 * 10,000 = 340,000 bytes are transferred. 3. Execute the query by joining the transferred file with Department and present the result to the user at site 2.  Using this strategy, we transfer 340,400 bytes for Q. Contd..
  • 29.   Input: Best global execution schedule • Use the centralized optimization techniques 4. Local Optimization
  • 30.   R. Elmasri, S.B. Navathe, “Fundamentals of Database Systems”, Fifth Edition,Pearson Education/Addison Wesley, 2007.  Henry F Korth, Abraham Silberschatz, S. Sudharshan, “Database System Concepts”, Fifth Edition, McGraw Hill, 2006. References