Homeworks

Students have a choice between an individual, independent research project (to be agreed upon with the course instructor), or a set of assignments that involve implementing several parts of a relational DBMS. If you choose to go with the homework assignments, you will have to turn in all of them without exception.

Documentation

The Minibase home page is mirrored locally. In particular, you will probably want to look at the overview and components documentation.

Communication

The newsgroup postings can be read from these pages as well. Please make sure you follow the announcements made here.

You can post to the newsgroup simply by sending email to bb+academic.cs.15-721@andrew.cmu.edu (besides posting directly on Andrew side). If you have a question about the assignment and want prompt response, please also make sure that you Cc the TA responsible for the assignment.

Policies

  • Handins:
    Programming assignments will be handed in electronically via AFS. For any given homework, the directory is

    /afs/cs/academic/class/15721-f01/handin/[Your Andrew ID]/[Homework tag]

    These directories should already have been created for you as need be, with relevant permissions. If you do not have the necessary permissions, be sure to cklog cs.cmu.edu and then e-mail lw2j@cs.cmu.edu with the full addresses of identities that need to be added.

    In general, we will be asking for only specific code and header files. See the homework handouts for details.

  • Testing
    Each programming assignment comes with its own test driver, based on the tests that come with the full Minibase distribution. These test drivers are generally noninteractive, and typically run a series of up to six test functions in sequence, stopping after the first test failure. We will try to verify that the tests are in ascending order of difficulty.

    You may, of course, write your own tests as well. We will be providing all the tests we use, however.

  • Grading
    Grading will be based directly on proportion of tests passed by the code, so it behooves you to test your program before submitting it.

Overview

A list of the various assignments that will be given follows. More information will be posted on each assignment during the progress of the course.

  • Assignment 1: Buffer Management
  • Assignment 2: Heap File
  • Assignment 3: Join Processing
  • Assignment 4: B-Trees
  • Assignment 5: External Sorting
  • Assignment 6: Optimizer

1. Buffer Management

Handout

Grade statistics

2. Heap File

Handout [PostScript]

Grade statistics

Clarifications/updates:

  • The assignment is due on Tuesday, October 9th (not 8th).
  • If for some reason you do only HFPage, you will still get credit for that (this is in case you noticed that the tests run in sequence and wonder...).
  • Grading details:
    • Equal weight on HeapFile and HFPage.
    • If you do not do a directory at all, max. grade is reduced by 30%.
    • If your HFPage implementation does not do proper space management (most notably, always "leaks"), again max. grade is reduced by 30%.
    • If you feel like doing something fancier (eg. for the directory), you will get a bonus (max. grade up by 20%).
    • Of course, your code must pass the tests....
    • Coding style and clarity will not affect grades (but please show some mercy--lest we change our minds in later assignments! :-).

3. Join Processing

Handout [PostScript]

Grade statistics

4. B-Trees

PostScript

Grade statistics

5. External Sorting

Handout [PostScript]

Clarifications/updates:

  • For the comparison function that you pass to qsort, use one like the following, and ignore the CompareTupleWithTuple mentioned in the handout:
     
        int tupleCmp (const void* t1, const void* t2)
        {
          if (s_order == Ascending)
            return strncmp((char*)t1,(char*)t2,key_size);
          else
            return strncmp((char*)t2,(char*)t1,key_size);
        }
         
    Include this function in sort.C as a plain function.
  • Please change line 87 of SORTTester.C from:
        s = f.insertRecord((char*)&rec,REC_LEN1,rid);
    
    to:
        s = f.insertRecord((char*)&rec,REC_LEN1 + REC_LEN2,rid);
    
    Note that your code should behave the same if you have deducted the record structure from the attributes passed to Sort()

6. Optimizer

Handout [PostScript]