SlideShare a Scribd company logo
1 of 13
Join Ordering in
Fragment Queries
By Shehab Uddin and Ifzal Hussain
Join Ordering in Fragment Queries
• Join ordering is important in centralized DB, and is more important in
distributed DB.
Join Ordering in Fragment Queries (cont.)
• R  site j: “relation R is transferred to site j”
• 1. EMP  site 2; site 2 computes EMP’
• EMP’->site 3; site 3 computes the result.
• 2.ASG->site 1: site 1 computes EMP’, EMP’->site
3; site 3 computes the result
• 3. ASG->site 3; computeASG’;ASG’->site 1
• 4. PROJ->site 2; compute PROJ’; PROJ’->site 1
• 5. EMP->site 2; PROJ->site 2; site 2 compute the
join.
Join Ordering in Fragment Queries (cont.)
• Join ordering
• Distributed INGRES
• System R*
• Semijoin ordering
• SDD-1
Join Ordering
• Consider two relations only
• R ⋈ S
• Transfer the smaller size
• Multiple relations more difficult because too many alternatives
• Compute the cost of all alternatives and select the best one
• Necessary to compute the size of intermediate relations which is difficult.
• Use heuristics
Join Ordering - Example
• Consider: PROJ ⋈PNO ASG ⋈ENO EMP
Join Ordering – Example (cont.)
• Execution alternatives:
• 1. EMP  Site 2
• Site 2 computes EMP’=EMP⋈ASG
• EMP’  Site 3
• Site 3 computes EMP’⋈PROJ
• 2.ASG  Site 1
• Site 1 computes EMP’=EMP⋈ASG
• EMP’  Site 3
• Site 3 computes EMP’⋈PROJ
Join Ordering – Example (cont.)
3. ASG  Site 3
Site 3 computes ASG’=ASG⋈PROJ
ASG’  Site 1
Site 1 computes ASG’⋈EMP
4. PROJ  Site 2
Site 2 computes PROJ’=PROJ⋈ASG
PROJ’  Site 1
Site 1 computes PROJ’ ⋈ EMP
cont,d
5. EMP  Site 2
PROJ  Site 2
Site 2 computes EMP⋈ PROJ⋈ASG
Semijoin Algorithms
• Shortcoming of the joining method
• Transfer the entire relation which may contain some useless tuples
• Semi-join reduces the size of operand relation to be transferred
• Semi-join is beneficial if the cost to produce and send to the other site is less than
sending the whole relation.
Semijoin Algorithms (cont.)
• Consider the join of two relations
• R[A] (located at site 1)
• S[A] (located at site 2)
• Alternatives
• 1. Do the join R ⋈A S
• 2. Perform one of the semijoin equivalents
( ) ( )
( ) ( )
A A A A A
A A A
R S R S S R S R
R S S R
   
  
Cnt,d
• Perform the join
• Send R to site 2
• Site 2 computes R ⋈A S
• Consider semijoin
• S’ = A(S)
• S’  Site 1
• Site 1 computes
• R’  Site 2
• Site 2 computes
• Semijoin is better if
( )
A A
R S S

' '
A
R R S
 
' A
R S
( ( ( )) ( )) ( )
A A
size S size R S size R
   
Join Ordering in Fragment Queries (JOQF

More Related Content

What's hot

Concurrency Control in Distributed Database.
Concurrency Control in Distributed Database.Concurrency Control in Distributed Database.
Concurrency Control in Distributed Database.Meghaj Mallick
 
Fragmentation and types of fragmentation in Distributed Database
Fragmentation and types of fragmentation in Distributed DatabaseFragmentation and types of fragmentation in Distributed Database
Fragmentation and types of fragmentation in Distributed DatabaseAbhilasha Lahigude
 
distributed shared memory
 distributed shared memory distributed shared memory
distributed shared memoryAshish Kumar
 
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
 
Clock synchronization in distributed system
Clock synchronization in distributed systemClock synchronization in distributed system
Clock synchronization in distributed systemSunita Sahu
 
network ram parallel computing
network ram parallel computingnetwork ram parallel computing
network ram parallel computingNiranjana Ambadi
 
Distributed file system
Distributed file systemDistributed file system
Distributed file systemAnamika Singh
 
Distributed Query Processing
Distributed Query ProcessingDistributed Query Processing
Distributed Query ProcessingMythili Kannan
 
Synchronization in distributed computing
Synchronization in distributed computingSynchronization in distributed computing
Synchronization in distributed computingSVijaylakshmi
 
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
 
Introduction to distributed file systems
Introduction to distributed file systemsIntroduction to distributed file systems
Introduction to distributed file systemsViet-Trung TRAN
 
DDBMS_ Chap 7 Optimization of Distributed Queries
DDBMS_ Chap 7 Optimization of Distributed QueriesDDBMS_ Chap 7 Optimization of Distributed Queries
DDBMS_ Chap 7 Optimization of Distributed QueriesKhushali Kathiriya
 
Distributed database management system
Distributed database management  systemDistributed database management  system
Distributed database management systemPooja Dixit
 

What's hot (20)

Query processing
Query processingQuery processing
Query processing
 
Ddbms1
Ddbms1Ddbms1
Ddbms1
 
Concurrency Control in Distributed Database.
Concurrency Control in Distributed Database.Concurrency Control in Distributed Database.
Concurrency Control in Distributed Database.
 
Fragmentation and types of fragmentation in Distributed Database
Fragmentation and types of fragmentation in Distributed DatabaseFragmentation and types of fragmentation in Distributed Database
Fragmentation and types of fragmentation in Distributed Database
 
distributed shared memory
 distributed shared memory distributed shared memory
distributed shared memory
 
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 ...
 
Lec 7 query processing
Lec 7 query processingLec 7 query processing
Lec 7 query processing
 
Distributed DBMS - Unit 5 - Semantic Data Control
Distributed DBMS - Unit 5 - Semantic Data ControlDistributed DBMS - Unit 5 - Semantic Data Control
Distributed DBMS - Unit 5 - Semantic Data Control
 
Clock synchronization in distributed system
Clock synchronization in distributed systemClock synchronization in distributed system
Clock synchronization in distributed system
 
network ram parallel computing
network ram parallel computingnetwork ram parallel computing
network ram parallel computing
 
Distributed DBMS - Unit 3 - Distributed DBMS Architecture
Distributed DBMS - Unit 3 - Distributed DBMS ArchitectureDistributed DBMS - Unit 3 - Distributed DBMS Architecture
Distributed DBMS - Unit 3 - Distributed DBMS Architecture
 
Distributed file system
Distributed file systemDistributed file system
Distributed file system
 
Distributed Query Processing
Distributed Query ProcessingDistributed Query Processing
Distributed Query Processing
 
Synchronization in distributed computing
Synchronization in distributed computingSynchronization in distributed computing
Synchronization in distributed computing
 
Distributed concurrency control
Distributed concurrency controlDistributed concurrency control
Distributed concurrency control
 
Database , 8 Query Optimization
Database , 8 Query OptimizationDatabase , 8 Query Optimization
Database , 8 Query Optimization
 
The CAP Theorem
The CAP Theorem The CAP Theorem
The CAP Theorem
 
Introduction to distributed file systems
Introduction to distributed file systemsIntroduction to distributed file systems
Introduction to distributed file systems
 
DDBMS_ Chap 7 Optimization of Distributed Queries
DDBMS_ Chap 7 Optimization of Distributed QueriesDDBMS_ Chap 7 Optimization of Distributed Queries
DDBMS_ Chap 7 Optimization of Distributed Queries
 
Distributed database management system
Distributed database management  systemDistributed database management  system
Distributed database management system
 

Recently uploaded

WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentationphoebematthew05
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 

Recently uploaded (20)

WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentation
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 

Join Ordering in Fragment Queries (JOQF

  • 1. Join Ordering in Fragment Queries By Shehab Uddin and Ifzal Hussain
  • 2. Join Ordering in Fragment Queries • Join ordering is important in centralized DB, and is more important in distributed DB.
  • 3. Join Ordering in Fragment Queries (cont.) • R  site j: “relation R is transferred to site j” • 1. EMP  site 2; site 2 computes EMP’ • EMP’->site 3; site 3 computes the result. • 2.ASG->site 1: site 1 computes EMP’, EMP’->site 3; site 3 computes the result • 3. ASG->site 3; computeASG’;ASG’->site 1 • 4. PROJ->site 2; compute PROJ’; PROJ’->site 1 • 5. EMP->site 2; PROJ->site 2; site 2 compute the join.
  • 4. Join Ordering in Fragment Queries (cont.) • Join ordering • Distributed INGRES • System R* • Semijoin ordering • SDD-1
  • 5. Join Ordering • Consider two relations only • R ⋈ S • Transfer the smaller size • Multiple relations more difficult because too many alternatives • Compute the cost of all alternatives and select the best one • Necessary to compute the size of intermediate relations which is difficult. • Use heuristics
  • 6. Join Ordering - Example • Consider: PROJ ⋈PNO ASG ⋈ENO EMP
  • 7. Join Ordering – Example (cont.) • Execution alternatives: • 1. EMP  Site 2 • Site 2 computes EMP’=EMP⋈ASG • EMP’  Site 3 • Site 3 computes EMP’⋈PROJ • 2.ASG  Site 1 • Site 1 computes EMP’=EMP⋈ASG • EMP’  Site 3 • Site 3 computes EMP’⋈PROJ
  • 8. Join Ordering – Example (cont.) 3. ASG  Site 3 Site 3 computes ASG’=ASG⋈PROJ ASG’  Site 1 Site 1 computes ASG’⋈EMP 4. PROJ  Site 2 Site 2 computes PROJ’=PROJ⋈ASG PROJ’  Site 1 Site 1 computes PROJ’ ⋈ EMP
  • 9. cont,d 5. EMP  Site 2 PROJ  Site 2 Site 2 computes EMP⋈ PROJ⋈ASG
  • 10. Semijoin Algorithms • Shortcoming of the joining method • Transfer the entire relation which may contain some useless tuples • Semi-join reduces the size of operand relation to be transferred • Semi-join is beneficial if the cost to produce and send to the other site is less than sending the whole relation.
  • 11. Semijoin Algorithms (cont.) • Consider the join of two relations • R[A] (located at site 1) • S[A] (located at site 2) • Alternatives • 1. Do the join R ⋈A S • 2. Perform one of the semijoin equivalents ( ) ( ) ( ) ( ) A A A A A A A A R S R S S R S R R S S R       
  • 12. Cnt,d • Perform the join • Send R to site 2 • Site 2 computes R ⋈A S • Consider semijoin • S’ = A(S) • S’  Site 1 • Site 1 computes • R’  Site 2 • Site 2 computes • Semijoin is better if ( ) A A R S S  ' ' A R R S   ' A R S ( ( ( )) ( )) ( ) A A size S size R S size R    