DACE: A Database-Agnostic Cost Estimator.
- Python 3.9.18
- Required Python packages (see
requirements.txt
)
Clone the repository and install the dependencies:
git clone [email protected]:liang-zibo/DACE.git
cd dace
pip install -r requirements.txt
Before running the code, please download the data from this data repository and put them in the data folder.
Modify ROOT_DIR in utils.py to your own path.
To filter out plans and gather statistical data, run:
python setup.py --filter_plans --get_statistic
To get plan encodings, run:
python run.py --process_plans
To sequentially use each database as a test set while treating the remaining databases as a training set, execute:
python run.py --test_all
To test and evaluate DACE's performance on the IMDB dataset (dataset ID: 13), without including any knowledge from the IMDB dataset in the training set, use:
python run.py --test_database_ids 13
cd data
mv DACE.ckpt DACE_imdb.ckpt
To directly test DACE as a pre-trained estimator on job-light, scale, and synthetic workloads:
python run_tuning.py
For fine-tuning and testing DACE as a pre-trained estimator on job-light, scale, and synthetic workloads:
python run_tuning.py --tune
If you have any questions about the code, please email [email protected]