Question
Consider the following relation and query: B(bid, accNo), accNo is a key. A(accNo, code, balance), accNo is a key. Select B.bid, Sum(A.balance) From B, A
Consider the following relation and query:
B(bid, accNo), accNo is a key.
A(accNo, code, balance), accNo is a key.
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. Discuss the plans of evaluating the query with lowest I/O cost. 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).
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started