代写 CS648 Project

CS648 Project
Idea​: Use Wiredtiger as a row store, i.e. store and fetch a complete row at a time from Wiredtiger.
Background: ​For CS648 A2 you have implemented wt.c that uses Wiredtiger to store blocks. Moving on from there. A block packages a set of rows of a relation. You need to store these rows individually, instead of storing the whole block as it is.
Subtasks:
1. Identify who sends the buffer to smgr. A buffer is packed with rows and then sent to mdwrite. Or a buffer is fetched from mdread and kept in memory for SELECT operation. Hint: check buffer manager and executor code. (nodeModifyTable.c – ExecModifyTable() – ExecInsert(), nodeSeqScan.c, heapam.c, bufmgr.c, smgr.c, md.c)
2. Figure out how are rows packed into a buffer and how to extract them. Hint: check these: heapam.c, bufpage.c (PageAddItem(bufpage)), .h.
3. At the storage layer, i.e. somewhere inside smgr directory implement a new storage engine that can unpack the block, (i.e. able to access each row of the block) and store the rows in Wiredtiger.
a. Identify a key for each row.
b. Map tuples to blocks. Each tuple has t_ctid field that can be used to tell where
and in which block does the tuple exist. You might have to store this mapping
as a metadata.
c. For mdread, you should be able to fetch all the tuples from Wiredtiger that
should belong to a given blocknum (use the above metadata to identify which
tuple go in the given block), pack them in the provided buffer and return.
d. Modify other md functions, such as mdnblocks, mdcreate, etc.
References​:
1. Setting up Postgres with eclipse.
https://wiki.postgresql.org/wiki/Working_with_Eclipse
2. Postgres 9.4.5 download ​http://www.postgresql.org/ftp/source/v9.4.5/