{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Lecture5DiscussionQ

# Lecture5DiscussionQ - In that case the join with ASG would...

This preview shows pages 1–2. Sign up to view the full content.

Transform the following query into a reduced query on fragments: SELECT BUDGET FROM PROJ, ASG WHERE PROJ.PNO = ASG.PNO AND ASG.PNO = ''P4'' Fragmentation rule: records with PNO< =‘P2’ are stored in PROJ1 records with PNO>‘P2’ are stored in PROJ2 My solution The general query on fragments is: SELECT BUDGET FROM PROJ1, ASG WHERE PROJ1.PNO = ASG.PNO AND ASG.PNO = ''P4'' UNION SELECT BUDGET FROM PROJ2, ASG WHERE PROJ2.PNO = ASG.PNO AND ASG.PNO = ''P4'' Tree for the fragmented query above Π budget σ PNO=”P4” U r PNO r PNO PROJ1 ASG PROJ2 ASG According to Ozsu and Valduriez (1999), the subtrees that produce an empty relation can be removed. This process is called the query reduction. In our case, the PROJ1 doesn’t have any records with PNO=”P4” based on the fragmentation rule. Hence, the join of PROJ1 and ASG would return an empty set. Therefore, we eliminate the left subtree.

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Based on the fragmentation rule, PROJ2 may have records with PNO=”P4”.
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: In that case, the join with ASG would not return an empty set. Therefore, that subtree remains. Because we have only one subtree left, the union operation is also eliminated. The reduced subtree is: Π budget σ PNO=”P4” r PNO PROJ2 ASG The corresponding query is: SELECT BUDGET FROM PROJ2, ASG WHERE PROJ2.PNO = ASG.PNO AND ASG.PNO = ''P4'' Based on the Figure 2.4, the Budget attribute is in the project relation, and the query doesn’t select any attributes from the ASG relation. According to Ozsu and Valduriez (1999) definition, we have a useless join that needs to be eliminated. The resulting query tree is: Π budget σ PNO=”P4” PROJ2 The corresponding query is: SELECT BUDGET FROM PROJ2 WHERE PNO=”P4” References Ozsu, M.T. & Valduriez, P. (1999). Principles of distributed database systems . New Jersey: Prentice Hall....
View Full Document

{[ snackBarMessage ]}

### Page1 / 2

Lecture5DiscussionQ - In that case the join with ASG would...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online