Database Reference
In-Depth Information
and C. In this case, the DDBMS must choose between sites B and C based on
optimum processing conditions. Let us say that site C is chosen. The DDBMS trans-
forms the query to execute on the copy at site C, changing the name of the relation
to the local name at site C. The result of the query is received at site A and pre-
sented to the user there. No union or join operations are necessary.
What we have considered here simply illustrates the principle of query trans-
formation, decomposition, and routing. The details are involved. Again, the
DDBMS has a number of options to transform and decompose a query based
on the partitioning and replication schemes. It makes the determination based
on query optimization techniques by considering all costs in the distributed data-
base environment.
Nonjoin Queries In the above subsection, we considered a very simple query and
reviewed the query transformation process. Let us go over a few more queries with
selection criteria, but without any explicit joins. We will present a few cases and
make general comments on the nonjoin queries.
Example 1
Query from site B: List of employees from departments with department
numbers 24 and 43.
Data distribution: EMPLOYEE relation partitioned horizontally. Employees
with department number 24 at site A and those with department number 43
at site C.
Action by DDBMS: Transform query incorporating local database object names,
execute query at sites A and C, receive results at site B, combine results
through union operation.
Example 2
Query from site A: List of employees from department number 31.
Data distribution: EMPLOYEE relation partitioned horizontally. Employees
with department number 31 at site B and all others at site C.
Action by DDBMS: Recognize that data for employees from department
number 31 are stored at site B. Transform query incorporating local database
object names, execute query at site B, receive results at site A.
Example 3
Query from site B: Find the average salary of employees from departments with
department numbers 24 and 43; average computed taking employees from
both departments together.
Data distribution: EMPLOYEE relation partitioned horizontally. Employees
with department number 24 at site A and those with department number 43
at site C.
Action by DDBMS: Recognize that averages cannot be computed individually
at each of the sites A and C and combined by union operation. Transform
Search WWH ::




Custom Search