Question: Consider the following relation and query: Relation: B(bid, accNo), accNo is a key. A(accNo, code, balance), accNo is a key. Query: SELECT B.bid, Sum(A.balance) FROM

 Consider the following relation and query: Relation: B(bid, accNo), accNo is

Consider the following relation and query: Relation: B(bid, accNo), accNo is a key. A(accNo, code, balance), accNo is a key. Query: SELECT B.bid, Sum(A.balance) FROM B, A WHERE B.accNo=A.accNo GROUP by B.bid This query computes the sum of the balances at each branch. Assume that there a clustered B+ tree index on B.bid and a hash index on A.accNo. 1.) Discuss/Explain the plans of evaluating the query with lowest I/O cost. 2.) If A and B have A and (B| pages, and each page has 100 records, what is the I/O cost? (Hint: use index to reduce the cost of join and sorting cost for aggregation). Explain steps and show you work. Consider the following relation and query: Relation: B(bid, accNo), accNo is a key. A(accNo, code, balance), accNo is a key. Query: SELECT B.bid, Sum(A.balance) FROM B, A WHERE B.accNo=A.accNo GROUP by B.bid This query computes the sum of the balances at each branch. Assume that there a clustered B+ tree index on B.bid and a hash index on A.accNo. 1.) Discuss/Explain the plans of evaluating the query with lowest I/O cost. 2.) If A and B have A and (B| pages, and each page has 100 records, what is the I/O cost? (Hint: use index to reduce the cost of join and sorting cost for aggregation). Explain steps and show you work

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!