curlorwgetfor quick install- Rust toolchain with
cargofor source builds makefor local development
make testSystem install to /usr/local/bin:
curl -fsSL https://raw.githubusercontent.com/papakvy/sql_doctor/main/install.sh | bash -s -- --systemLatest release to $HOME/.local/bin:
curl -fsSL https://raw.githubusercontent.com/papakvy/sql_doctor/main/install.sh | bashSpecific release:
curl -fsSL https://raw.githubusercontent.com/papakvy/sql_doctor/main/install.sh | bash -s -- --version v2.0.5Temporary build from the current main branch:
curl -fsSL https://raw.githubusercontent.com/papakvy/sql_doctor/main/install.sh | bash -s -- --from-git mainBuild and install from source:
[sudo] make installCustom prefix:
make install PREFIX="$HOME/.local"If you install to a custom prefix, make sure the target bin directory is on your PATH:
export PATH="$HOME/.local/bin:$PATH"sql_doctor -v
# sql_doctor 2.0.5 (2026-06-10)- Default value:
--execution-time = 1000,--top = 15and--multiple-pattern = n
Use the installed command:
sql_doctor /path/to/log/file.logOr run the development binary from the repository:
cargo run -- /path/to/log/file.logThe previous Bash implementation is kept as sql_doctor.bash for comparison and benchmarking:
./sql_doctor.bash /path/to/log/file.logsql_doctor -e 5000 /path/to/log/file.log
# Explain
- Get all SQLs in the `/path/to/log/file.log` with `--execution-time >= 5000 miliseconds`- Keep only the top N slowest SQLs before sorting the final output. The default is
--top 15.
sql_doctor -e 1000 --top 100 /path/to/log/file.log- Include every matching SQL instead of limiting the report to top results.
sql_doctor -e 1000 --all /path/to/log/file.log[sudo] make uninstallIf you installed with a custom prefix, uninstall with the same prefix:
make uninstall PREFIX="$HOME/.local"- Fork it ( https://github.com/papakvy/sql_doctor/fork )
- Create your feature branch (
git checkout -b my-new-feature) - Commit your changes (
git commit -am 'Add some feature') - Push to the branch (
git push origin my-new-feature) - Create a new Pull Request
You can build and run SQL Doctor as a container.
docker build -t sql_doctor .docker run --rm -v "$PWD:/data" sql_doctor -e 1000 /data/path/to/logfile.logThe repository now includes a GitHub Actions workflow that publishes a Docker image to GHCR when you push a tag like v1.0.7.
docker pull ghcr.io/<owner>/sql_doctor:v1.0.7