Query Processing Solution
3a1) project Book#, Price, Ccity, Order_date
|
select Ccity = "GA", Order_date > 990101, Price > 50
|
-----------------X------------------
| | |
CUSTOMER BOOK ORDER
3a2)
|
|
--------------join--------------
| |
project Book#, Order_idate, Ccity |
| |
-----------join------------ project Book#, Price
| | |
project Cid, Ccity | select Price > 50
| | |
select Ccity = "GA" | BOOK
| |
CUSTOMER project Book#, Order_idate, Cid
|
select Order_idate > "990101"
|
ORDER
3b) 1,000,000 / (4.5 million X 1,000,000) = 1 / (4.5 million)
Note that the answer is not 1 / (1 million) since ORDER join BOOK
can't give back more than the number of orders in the DB.
3c) One topic is 1/1000 of the total database of 4.5 million books, or
4,500 books. With 100 books to a block, they are stored on 45 blocks.
Assuming the index is resident in memory, there are then 45 accesses.
(Using formula S5 in the text, x = 0, because the index is in memory,
s = 4500, bfr=100, so Cs5 = x + ceil(s/bfr) = 45.)
Wai Gen Yee
Last modified: Thu Dec 16 02:21:06 IST 1999