Database Reference
In-Depth Information
the appropriate place, combine the results through union or join operations,
and present the result to the requestor. While decomposing a query and executing
subqueries the optimizer examines the options and chooses the most optimal exe-
cution. Let us consider some possible scenarios of query decomposition.
Horizontal Partitioning Assume that the DEPARTMENT relation is partitioned
horizontally into three fragments, DEP-H-A, DEP-H-B, DEP-H-C, with each site
storing the appropriate fragment. The DDBMS may transform the query into three
subqueries: Subquery-A, Subquery-B, Subquery-C. For example, Subquery-A is as
follows:
SELECT *
FROM DEP-H-A
We are neither getting into the exact technical details of how the DDBMS looks
up the system catalog and transforms the original query nor getting into the exact
format of the query. However, please note the principles of query transformation.
The DDBMS processes Subquery-A at the local site A and dispatches the other two
subqueries to sites B and C, respectively. When the results are received from sites
B and C, the results are consolidated through union operation and presented to the
user at site A.
Vertical Partitioning Assume that the DEPARTMENT relation is partitioned
vertically into two fragments, DEP-V-B and DEP-V-C, with each site storing the
appropriate fragment. The DDBMS may transform the query into two subqueries:
Subquery-B, Subquery-C. For example, Subquery-B is as follows:
SELECT *
FROM DEP-V-B
No department data are stored at the local site of the user. The DDBMS dis-
patches the two subqueries to sites B and C, respectively. When the results are
received from sites B and C, the results are consolidated through union operation
and presented to the user at site A.
Hybrid Partitioning In this case, assume that the DEPARTMENT relation is first
partitioned horizontally into two fragments, DEP-H-A and DEP-H-BC, and that
site A stores fragment DEP-H-A. Fragment DEP-H-BC is portioned further verti-
cally into two vertical partitions, DEP-H-BC-V-B and DEP-H-BC-V-C, stored at
sites B and C, respectively. The DDBMS may transform the original query into three
subqueries, each executing on the appropriate fragments at sites A, B, and C. The
results from sites B and C are first put together through a join operation, and
then the result of this join is combined with the result from site A through a union
operation.
Replication Let us consider one case with replication. Assume that the DEPART-
MENT relation is not partitioned but replicated. Full copies are stored at sites B
Search WWH ::




Custom Search