6.893
Architecture of Database Systems
Term Project, due May 17, 2002
Obtain a copy of POSTGRES off the web, and load it onto some machine
that you have access to. Do one of the following two assignments.
There is no write-up required. Instead you will be asked to demo your
prototype in person on the 17th. You will need to construct a
convincing demo to accomplish this. Lastly, you must work alone. Make
sure you read papers 5 and 6 of Chapter 6 of the red book before you
begin.
1) abstract data type exercise (easiesr task)
Implement an abstract data type in POSTGRES that supports "Wall Street
Trading Date" (WSTD). This data type is represented externally as a
pair (year, integer); for example, (2002, 3) represents the third
trading day of 2002 (which I believe is Jan 4th). When, year is not
specified, the default is the current year, so 3 represents January 4,
2002. Choose some reasonable internal representation for the WSTD data
type and implement the following operations:
- Same_year (WSTD-1, WSTD-2) returns Boolean; this returns true if the
values are in the same year.
- Same_day_of_week (WSTD-1, WSTD-2) returns Boolean; this returns true if
the two values are the same day of the week.
- Distance (WSTD-1, WSTD-2) returns integer; this returns the number of
trading days between the two WSTDs.
- Mon (WSTD), Tues (WSTD), Wed (WTD), Thu (WSTD), Fri (WSTD) returns
Boolean; these have the obvious interpretation.
- DJIA (WSTD) returns float; returns the Dow Jones Industrial Average on
this date
- Date (WSTD) returns Date; returns the calendar date of the given WSTD
- Greater_than (WSTD-1, WSTD-2) returns Boolean
- Less_than (WSTD-1, WSTD-2) returns Boolean
- Greater_Equal (WSTD-1, WSTD-2) returns Boolean
- Less_Equal (WSTD-1, WSTD-2) returns Boolean
- Equals (WSTD-1, WSTD-2) returns Boolean
In addition, POSTGRES should be taught how to construct B-tree indexes
on the WSTD type and the optimizer should be taught how to utilize the
resulting indexes.
Note:
Wall Street Trading Date: defined to be those days on which the NYSE
trades shares. Best way to figure this out is to go to a financial web
site (e.g. schwab.com, finanacial section of yahoo.com, etc.) and build
a definition by looking at the trading days over the last several
months.
Reason to give you this data type is it represents typical issues faced
in data type construction. Semantics must be "discovered".
DJIA (WSTD): can look up on the fly from a web site or download in
advance. Your choice.
2) POSTGRES enhancement (hard - don't do this unless you are very
confident)
Add bit-map indexes to POSTGRES. Construct syntax and an implementation
for a create index facility. Change the optimizer so it can make use of
your indexes. Change the executor so it can deal with such indexes.