Skip to content
No description, website, or topics provided.
TSQL Python Other
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.


A system for distinguishing candidate SQL queries using system-suggested tuples.

System Setup

Create a virtual environment and activate it:

cd python
virtualenv venv
source venv/bin/activate
pip install -r requirements.txt


cd python
cp config.ini.example config.ini

Then make sure the variables set in config.ini are what you want (in particular, the MySQL credentials must be set correctly!).


Download the following datasets and load into MySQL:

Load Datasets

For datasets you want to use, run the following:

cd python
python <db_name>
python <db_name>
python <db_name>

Run Experiments

For each experiment, run:

cd python
python <arguments>

Example: python mondial greedyall --tq_rank=equal

Required Arguments:

  • db: database name
  • mode: type of algorithm to use, select from topw, greedyall, greedybb, greedyfirst, l1s

Optional Arguments:

  • tq_rank: target query rank using weighting scheme described in the paper; select from equal, 1, q1 (n/4), half (n/2), q3 (3n/4), n. Default is equal.
  • qid: if you only want to run one task in the dataset, specify the ID of the task to run
  • info: either type or range. Just use range which uses both information sources (data types and intersecting values) described in the paper.
  • email: specify an email address to have the system email you when it's done with the task or if there's an error


Logs for tasks are generated in python/log/<db>_<mode>_tq<tq_rank>.


After all tasks are completed, results are pickled into results/<db>_<mode>_tq<tq_rank>.pkl.

Analyzing Results

Analyzing results can be done using:

cd python
python <arguments>

Required Arguments:

  • db: database name
  • mode: type of algorithm used (see list above)
  • tq_rank: see list above

Optional Arguments:

  • qid_min: only evaluate tasks with ID greater than or equal to this number
  • qid_max: only evaluate tasks with ID less than or equal to this number
  • tqc_min: only evaluate tasks with TQC value greater than this value
  • tqc_max: only evaluate tasks with TQC value less than or equal to this value
You can’t perform that action at this time.