Run EXPLAIN on Wikimedia Toolforge SQL queries
https://sql-optimizer.toolforge.org
You can report bugs or make feature requests by filing an issue on GitHub: https://github.com/MusikAnimal/sql-optimizer/issues
Or you can use on
Wikimedia's Phabricator.
Please tag with the Tools
project and add MusikAnimal
as a subscriber.
Prerequisites:
- Node.js with the version specified by .nvmrc.
- npm
- A Wikimedia developer account and access to the Toolforge environment.
Installation:
-
git clone https://github.com/MusikAnimal/sql-optimizer
-
cd sql-optimizer
-
npm install
-
Establish an SSH tunnel to the Toolforge replicas. It is important to connect to a specific database server. The command will be something similar to:
ssh -L 4711:enwiki.web.db.svc.eqiad.wmflabs:3306 [email protected]
-
cp env.json.dist env.json
and fill out the details. In the above example, thedb_port
would be4711
. -
npm run-script build && npm run-script start
- note you will need to re-run this command as you make changes during development. -
You should be up and running at http://localhost:8000
-
Note you can only query against the database you set up in your SSH tunnel (
enwiki
in the above example). In production, the host in env.json is set to*.web.db.svc.eqiad.wmflabs
which gets changed to the appropriate host for the given database at run time.