This is the artifact for the paper Erupt: Learned UDF Predicate Placement for Query Optimization.
conda create -n erupt python=3.9.23
conda activate erupt
python -m pip install -r requirements.txtExtract UDF features:
python udf_feature_extractor.py --db_name imdbTraining (Latency-based):
python run_train.py --db_name imdb --algo dqn
python run_train.py --db_name imdb --algo ppoTraining (Cost-based):
python run_train.py --db_name imdb --algo dqn --use_cost_model True
python run_train.py --db_name imdb --algo ppo --use_cost_model TrueTest:
python run_test.py --db_name imdb --algo ppo --model_path xxxx_xxxxxx_ppo_best_policy_val.ptdatasets/: datasets, workloads, UDFs.models/: trained models.cache/: cached execution plans.logs/: training logs.
- IMDB: Follow instructions from IMDB; UDFs from DataManagementLab/Graceful.
- TPC-H: Download from the official TPC-H; UDFs from DataManagementLab/Graceful.
- UDFBench: Download from the official UDFBench. After loading the data, run
datasets/udfbench/rename.sqlto rename the columns.
- Opt-rank: Chaudhuri and Shim, Optimization of Queries with User-Defined Predicates.
- RTOS: TsinghuaDatabaseGroup/RTOS.
- Graceful: DataManagementLab/Graceful.