CS 357: Database Systems Implementation
Homework Assignment 7 -- Scans
| Given: |
Wednesday, 19 March |
| Due Date: |
Monday, 31 March |
1. Do Exercise 17.19 in the text. This exercise asks you to modify SimpleDB so that scans have the method afterLast and previous.
Clearly, you will need to use your solution to the previous
assignment. If your solution does not work, then email me and
I'll let you use my solution. The code for this exercise is not
difficult
to write, but you have to change several files. I'm not telling
you which ones -- that is part of the assignment.
Changing the Scan interface will break classes in the simpledb.query package (which you have to fix), as well as classes in the simpledb.materialize, simpledb.nultibuffer, and simpledb.index.query
packages (which you don't have to fix). If you are using Eclipse
and it complains that classes are broken, tell it not to worry.
However, you should make sure that the method SimpleDB.planner in the package simpledb.server looks like this:
public static Planner planner() {
QueryPlanner qplanner = new BasicQueryPlanner(); //not HeuristicQueryPlanner!
UpdatePlanner uplanner = new BasicUpdatePlanner(); //not IndexUpdatePlanner!
return new Planner(qplanner, uplanner);
}
2. It is sad that
you don't yet know how to make your changes available to JDBC clients.
(This issue will be covered in Chapter 20.) So I will give
you the changes you need. In particular, download the revised
files RemoteResultSet.java, RemoteResultSetImpl.java, and SimpleResultSet.java and put them in the folder for simpledb.remote. Then see if everything works. Modify the SQLInterpreter class so that it prints the answer to all queries backwards, and hand that in.
3. Do Exercises 17.15(b) and 17.15(d) in the
text. You need to determine the appropriate estimation formulas used in the Plan classes. Your Scan classes should also implement methods afterLast and previous, as in problem #1 above. Please test your code as usual. When it works, run it on my program Hw7cTest, and print the results to hand in.
As usual, submit a printout of each file you create or
modify, with changes
indicated.
If your code doesn't work correctly, include a note
saying what is going wrong. PLEASE indicate changes as obviously
as possible for each problem. You are going to be submitting a lot
of code, most of which is unchanged; I'd like to be able to find
your stuff quickly.