This is the repository of an SPJ query prosessing engine. It consiits of scanner, parser, query optimizer, and several implemented operators.
This repository is an archive of the course project of CS3223: Database System Implementation, AY2019-2020, Sem 2, National University of Singapore.
The professor of the course is Prof. Tan Kian Lee. Here is his website: https://www.comp.nus.edu.sg/~tankl/
Collaborator to this project: @LevanaRu @treetree33
Javacup is used as the parser in this project. For more information, please check http://www.cs.princeton.edu/~appel/modern/java/CUP.
JLex is used as the scanner in this project. For more information, please check http://www.cs.princeton.edu/~appel/modern/java/JLex/.
We implemented Block Nested Join, Sort Merge Join, Distinct, Order by and External Sort operators. Implementation is available under src/qp
.
The original optimizer in the code base is an implementation of an Iterative Improvement Algorithm, based on which we implemented a 2 Phase Optimization Algorithm by adding a Simulated Annealing part to the optimzer. Performance analysis and algorithm details can be found on https://www.comp.nus.edu.sg/~tankl/cs3223/project/random.pdf.
- type
source queryenv
to add the necessary environment variables - type
./build.sh
to build the project - type
java QueryMain <queryname>.in <outputname>.out
to execute the query - (Optional) if you wanna change the parser to support more keywords, check https://www.comp.nus.edu.sg/~tankl/cs3223/project/developer.htm
- (Optional) if you wanna build up your own dataset to test,
RandomDB.java
andConvertTxtToTbl.java
would be helpful