mongo/buildscripts/cost_model
Asher Kornfeld 684585f237 SERVER-107356 Create workload for calibrating the cost of LIMIT (#38543)
GitOrigin-RevId: 9b6ad6811077fe3a172810e08ff74197ffd67f95
2025-07-15 18:56:23 +00:00
..
.gitignore SERVER-107356 Create workload for calibrating the cost of LIMIT (#38543) 2025-07-15 18:56:23 +00:00
BUILD.bazel SERVER-100631 Add ruff into "bazel run lint" (#32166) 2025-06-11 14:11:11 +00:00
OWNERS.yml SERVER-103079 Replace granular QO code owners teams with a single coarse team (#34298) 2025-04-10 06:25:19 +00:00
README.md SERVER-106252 Remove ABT from experiment pipeline and complete test run (with no data) (#37595) 2025-06-27 17:34:28 +00:00
benchmark.py SERVER-106251 Modify cost model calibration code to be able to parse classic execution trees (#37438) 2025-06-20 20:55:36 +00:00
calibration_settings.py SERVER-107356 Create workload for calibrating the cost of LIMIT (#38543) 2025-07-15 18:56:23 +00:00
ce_data_settings.py SERVER-94077 Use isort in Ruff configs (#27865) 2024-10-10 19:33:49 +00:00
ce_generate_data.py SERVER-104999 port motor to pymongo async (#36697) 2025-05-30 13:07:39 +00:00
common.py SERVER-106251 Modify cost model calibration code to be able to parse classic execution trees (#37438) 2025-06-20 20:55:36 +00:00
config.py SERVER-106252 Remove ABT from experiment pipeline and complete test run (with no data) (#37595) 2025-06-27 17:34:28 +00:00
cost_estimator.py SERVER-107356 Create workload for calibrating the cost of LIMIT (#38543) 2025-07-15 18:56:23 +00:00
data_generator.py SERVER-104999 port motor to pymongo async (#36697) 2025-05-30 13:07:39 +00:00
database_instance.py SERVER-106252 Remove ABT from experiment pipeline and complete test run (with no data) (#37595) 2025-06-27 17:34:28 +00:00
end_to_end.py SERVER-106252 Remove ABT from experiment pipeline and complete test run (with no data) (#37595) 2025-06-27 17:34:28 +00:00
execution_tree_classic.py SERVER-106251 Modify cost model calibration code to be able to parse classic execution trees (#37438) 2025-06-20 20:55:36 +00:00
execution_tree_sbe.py SERVER-106251 Modify cost model calibration code to be able to parse classic execution trees (#37438) 2025-06-20 20:55:36 +00:00
experiment.py SERVER-106252 Remove ABT from experiment pipeline and complete test run (with no data) (#37595) 2025-06-27 17:34:28 +00:00
mongod-inmemory.yaml SERVER-96080: Remove references to bonsai in buildscripts/cost_model (#32641) 2025-04-09 22:23:09 +00:00
mongod.yaml SERVER-96080: Remove references to bonsai in buildscripts/cost_model (#32641) 2025-04-09 22:23:09 +00:00
parameters_extractor_classic.py SERVER-106252 Remove ABT from experiment pipeline and complete test run (with no data) (#37595) 2025-06-27 17:34:28 +00:00
parameters_extractor_sbe.py SERVER-106252 Remove ABT from experiment pipeline and complete test run (with no data) (#37595) 2025-06-27 17:34:28 +00:00
physical_tree.py SERVER-94077 Use isort in Ruff configs (#27865) 2024-10-10 19:33:49 +00:00
qsn_calibrator.py SERVER-107356 Create workload for calibrating the cost of LIMIT (#38543) 2025-07-15 18:56:23 +00:00
qsn_costing_parameters.py SERVER-106252 Remove ABT from experiment pipeline and complete test run (with no data) (#37595) 2025-06-27 17:34:28 +00:00
query_solution_tree.py SERVER-106251 Modify cost model calibration code to be able to parse classic execution trees (#37438) 2025-06-20 20:55:36 +00:00
random_generator.py SERVER-94077 Use isort in Ruff configs (#27865) 2024-10-10 19:33:49 +00:00
requirements.txt SERVER-104999 port motor to pymongo async (#36697) 2025-05-30 13:07:39 +00:00
start.py SERVER-107356 Create workload for calibrating the cost of LIMIT (#38543) 2025-07-15 18:56:23 +00:00
workload_execution.py SERVER-106252 Remove ABT from experiment pipeline and complete test run (with no data) (#37595) 2025-06-27 17:34:28 +00:00

README.md

Cost Model Calibrator

Python virtual environment

The following assumes you are using python from the MongoDB toolchain.

/opt/mongodbtoolchain/v4/bin/python3

Getting started

Make sure before running start.py, you have a locally running mongod instance (this must be run using the mongo-python3 virtual environment, so do it before step 1 below).

(mongo-python3) deactivate  # only if you have another python env activated
sh> /opt/mongodbtoolchain/v4/bin/python3 -m venv cm  # create new env
sh> source cm/bin/activate  # activate new env
(cm) python -m pip install -r requirements.txt  # install required packages
(cm) python start.py  # run the calibrator
(cm) deactivate  # back to bash
sh>

Install new packages

(cm) python -m pip install <package_name>     # install <package_name>
(cm) python -m pip freeze > requirements.txt  # do not forget to update requirements.txt