This repository is a template for SQLite benchmark with any SQL. You can evaluate many queries at the same time with various parameters like different database files or whether to drop page cache.
- Template system: You can make many benchmark environments using this repository as a template. You can use installation tool to make an environment quickly.
- Graph: It’s easy to get various graphs. You can set graph-parameter and plot-parameter to specify parameters to split graphs or plots.
- Easy configuration: You can write experimental environments, SQLs, and parameters as you like.
Only you have to do is to modify these 3 files.
- python/SQL.py
- python/Config.py
- make/Makefile
- Powerful SQL description: SQLs to evaluate should be written in Python string object.
You can use convenient predefined function to get many SQLs at a time.
See the example below:
Util.get_str_allpairs( "SELECT COUNT (*) FROM '%s' WHERE junk = %d;", [["INBOX", "Trash", "Draft"], [0, 1]] ) # Results in: [ "SELECT COUNT (*) FROM 'INBOX' WHERE junk = 0;", "SELECT COUNT (*) FROM 'INBOX' WHERE junk = 1;", "SELECT COUNT (*) FROM 'Trash' WHERE junk = 0;", "SELECT COUNT (*) FROM 'Trash' WHERE junk = 1;", "SELECT COUNT (*) FROM 'Draft' WHERE junk = 0;", "SELECT COUNT (*) FROM 'Draft' WHERE junk = 1;", ]
- Add install/sqlite-benchmark-install.py into your PATH
- Hit sqlite-benchmark-install.py command in an empty directory in which you want to construct benchmark environment.
- Modify these 3 files to fit your experimental environment. python/SQL.py , python/Config.py , and make/Makefile
- Just hit `make’ command in make/ directory.
- You get graphs in resultsGraph/ directory.
I used these scripts with a little modifications.