It is an assignment of course Database System Implementation (COP6726) taught in University of Florida.
We are going to build some basic operations of database like SUM, DISTINCT, JOIN, FILTER etc on different kind of DB Files i.e. Heap and Sorted DB Files. The project is divided into several milestones.
-
Heap DB File - Implement records as heap file fashion, in which we keep on appending records at the end of file. We can load records from a file, insert single record and fetch records simply and on filter basis.
-
More details about the assignment and implementation can be read here.
-
Code implementation can be found in HeapDBFile.cc.
-
GTests are written in HeapFileGTests.cc
-
Use driver a1-test.cc to run the code.
-
In the project directory, execute below commands:
make clean make a1test.out ./a1test.out
Note : We are using tpch-dbgen as sample data which can download from https://github.com/electrum/tpch-dbgen.git and generated by
./dbgen -s 1
, which will generate 1 GB of data. Then updatetpch_dir
variable to location of generated data in a1-test.cc.
-
-
BigQ Sorter - Implement an two pass multi-way merge sort (TPMMS), which will takes some data as input pipe, sort them using TPMMS and returns data through output pipe. It runs on a thread so it keep on sorting data without blocking the process.
- More details about the assignment and implementation can be read here (Assignment 2 Milestone 1).
- Code implementation can be found in BigQ.cc.
- Use driver a2-test.cc to run the code. It will ask for the run length of TPMMS and sort order. Sort order should be columns of the table which can be found in catalog for the respective table.
- In the project directory, execute below commands:
NOTE : We will need heap files generated in the assignment, so we need to run the a1-test for the table which we want to sort.
make clean make a2test.out ./a2test.out
-
Sorted DB File - Implement records as sorted file fashion. We use BigQ sorter implemented in assignment 2 for sorting. We can load records from a file, insert single record and fetch records simply and on filter basis. We use binary search for filter if the filter order is similar to sort order of the file.
- More details about the assignment and implementation can be read here (Assignment 2 Milestone 2).
- Code implementation can be found in SortedDBFile.cc.
- Use driver a2-2test.cc to run the code. It will ask for the run length of TPMMS and sort order. Sort order should be columns of the table which can be found in catalog for the respective table.
- In the project directory, execute below commands:
Note : We are using tpch-dbgen as sample data which can download from https://github.com/electrum/tpch-dbgen.git and generated by
make clean make a2-2test.out ./a2-2test.out
./dbgen -s 1
, which will generate 1 GB of data. Then updatetpch_dir
variable to location of generated data in test.h.
-
Relational Operations - Implement different database operations like SELECT, SUM, DISTINCT, JOIN, FILTER etc.
- More details about the assignment and implementation can be read here
- Code implementation can be found in RelOp.cc.
- Use driver test.cc to run the code. We need to pass different test code which should be in range of 1 to 8.
- In the project directory, execute below commands:
NOTE : We will need heap files generated in the assignment, so we need to run the a1-test for all the tables.
make clean make test.out ./test.out <1..8>