Lecture5DiscussionQ

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

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

View Full Document Right Arrow Icon
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.
Background image of page 1

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

View Full DocumentRight Arrow Icon
Based on the fragmentation rule, PROJ2 may have records with PNO=”P4”.
Background image of page 2
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 doesnt 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. &amp; Valduriez, P. (1999). Principles of distributed database systems . New Jersey: Prentice Hall....
View Full Document

This note was uploaded on 12/23/2009 for the course DBST 663 taught by Professor Tba during the Spring '09 term at MD University College.

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 Right Arrow Icon
Ask a homework question - tutors are online