Query Decomposition
Query Decomposition
Parsing and Translation: The system checks the syntax of the user's query and
translates it into an internal representation, often using relational algebra. This
ensures the query is valid and prepares it for optimization.
Query Decomposition: The translated query is broken down into simpler, more
manageable components. This step involves normalization, analysis,
simplification, and restructuring to facilitate efficient processing.
Data Localization: The system identifies which fragments of data are required
and where they are located across the distributed network. It then transforms the
query to operate on these specific data fragments.
Global Query Optimization: Various execution strategies are evaluated to
determine the most efficient plan. This involves considering factors like data
location, network latency, and resource availability.
Distributed Execution: The optimized query plan is executed across the relevant
sites. Results from different locations are combined and presented to the user as a
single output.
This reduces the number of tuples involved in the join operation later, improving
performance.
Next, we perform a join between the Student table and the filtered Course records:
Only the relevant students enrolled in the 'Math' course are considered.
This gives us complete information about the student, their course, and the teacher.
Why Decomposition
Performance Improvement: Filtering early reduces data volume during joins.
Better Optimization: Subqueries can be executed independently and even
distributed across sites.
Modularity: Easier to manage and optimize small queries than one large
complex query.