DBMS Topics
Distributed Query Processing
Last Updated : 21 May, 2026
Distributed query processing involves decomposing a global query into sub-queries, executing them at the appropriate sites, and combining the results.
Overview
Distributed query processing involves decomposing a global query into sub-queries, executing them at the appropriate sites, and combining the results.
Steps in Distributed Query Processing
Communication Cost Model
Query Decomposition Example
| Employee(EmpID, Name, DeptID) | at Site A (Delhi) |
| Department(DeptID, DeptName) | at Site B (Mumbai) |
| Query | SELECT Name FROM Employee e JOIN Department d |
| 1. Compute σ_{DeptName='CS'}(Department) at B | {DeptID=1} |
| 3. A computes | π_{Name}(Employee ⋈ {DeptID=1}) |
| Communication cost | send 1 tuple + return result |
| Communication cost: send entire Employee table | expensive! |
Semi-Join Technique
Used to reduce the amount of data transferred:
Semi-join of R with S on attribute A
R ⋉ S = π_R(R ⋈ S) — result contains only R's columns
Benefit: Instead of sending all of S, send only S's join attributes.
Then only matching tuples of R are sent back.
Algorithm
1. Project S on join attribute A: Proj_S = π_A(S) (small!)
2. Send Proj_S to R's site
3. Compute R' = R ⋉ Proj_S (filter R to matching tuples)
4. Send R' to S's site (or result site)
5. Complete the join at destination
Trade-off: Extra message vs. much less data transferred
Effective when S is large and join attribute has low selectivity
Join Ordering in Distributed Query
For a query joining tables at different sites, join order matters:
| Tables | A (Site 1), B (Site 2), C (Site 3) |
| Option 1 | (A ⋈ B) at Site 1, then ⋈ C |
| Option 2 | (B ⋈ C) at Site 2, then ⋈ A |
Exam Focus
Revise definitions, diagrams, examples, and short-answer points for Distributed Query Processing.
Interview Use
Prepare one clear explanation, one practical example, and one common mistake for this DBMS topic.
Search Terms
dbms, database management system, database notes, sql, unit, distributed, query, processing
Related DBMS Topics