CS 564 - Assignment 3 FAQ
Note:
- Do NOT add any private data members to any of
SortedPage, BTIndexPage or BTLeafPage.
-
The makefile is only a skeleton which you have to modify to suit your
particular implementation. (You have to setup the dependencies in the
Makefile).
-
The error messages can be registered in the function main,
in the driver.
Questions about...
RecordPage
SortedPage
BTIndexPage
BTLeafPage
RecordPage
- What is the difference between HFPage and RecordPage?
There are 3 new functions in the RecordPage class.
- compact_slot_dir - compacts the slot directory
on a RecordPage. It changes the RIDs, so use it with caution. It
will be helpful to compact the slot directory before you perform
an insertion. It will also help if you are planning to use binary
search on a BTIndexPage or a BTLeafPage.
- page_no - returns the page number of the RecordPage.
- set_type, get_type - There is an additional byte of
storage allocated on a RecordPage to store the kind of Page. This
byte can be manipulated using these functions.
- Do I have to know the internal structure of a RecordPage?
Unfortunately, YES. You will have to manipulate the slot directory
entries while sorting (implementation of class SortedPage).
- Can i get some information about RecordPage?
Here is a pointer to record_page.C and record_page.h
SortedPage
- Is compaction of slot directories done
automatically?
NO. Holes in the slot directory are not
filled. There is a function in RecordPage (compact_slot_dir())
which you have to call for compaction.
- How do I combine a key and a PageId ?
func(void * key, PageId pageNo)
{
char * recPtr = new char [sizeof(int) + sizeof(PageId)];
memcpy(recPtr, (char *) key, sizeof(int));
memcpy(recPtr+sizeof(int), (char *) &pageNo, sizeof(PageId));
.
.
.
}
(Note, this version will work for integer keys only)
BTIndexPage
- What is stored on a BTIndexPage?
(key, pageId) pairs.
BTLeafPage
- What is stored on a BTLeafPage?
(key, dataRid) pairs, where dataRid is the record-id
of the data record of the B+ Tree.
Back to the cs564 home page
|