This is the code for the hyperQO: "Cost-based or Learning-based? A Hybrid Query Optimizer for Query Plan Selection" paper. This is an experimental version, and we will release a code in the form of a PostgreSQL plug-in in the future to realize parallel computing and reduce planning overhead.
- Pytorch 1.0
- Python 3.7
- torchfold
- psqlparse
We made some fixes to pg_hint_plan to better support the leading hint of prefixes. The PostgreSQL and pg_hint_plan is here[https://github.com/yxfish13/PostgreSQL12.1_hint].
```sh
cd postgresql-12.1/
./configure --prefix=/usr/local/pgsql --with-segsize=16 --with-blocksize=32 --with-wal-segsize=64 --with-wal-blocksize=64 --with-libedit-preferred --with-python --with-openssl --with-libxml --with-libxslt --enable-thread-safety --enable-nls=en_US.UTF-8
make
make install
```
```sh
cd postgresql-12.1/pg_hint_plan-REL12_1_3_6/
make
make install
```
- configurate the ImportantConfig.py
- run
python3 run_mcts.py