Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sanpii/explain
Transform postgresql explain to a graph
https://github.com/sanpii/explain
explain postgresql
Last synced: 18 days ago
JSON representation
Transform postgresql explain to a graph
- Host: GitHub
- URL: https://github.com/sanpii/explain
- Owner: sanpii
- Created: 2020-03-13T20:53:10.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2024-11-06T15:44:27.000Z (2 months ago)
- Last Synced: 2024-12-07T07:51:24.695Z (30 days ago)
- Topics: explain, postgresql
- Language: Rust
- Homepage:
- Size: 12.5 MB
- Stars: 57
- Watchers: 4
- Forks: 5
- Open Issues: 1
-
Metadata Files:
- Readme: docs/README.md
- Funding: docs/FUNDING.yml
Awesome Lists containing this project
README
# Explain
[![Github actions](https://github.com/sanpii/explain/workflows/.github/workflows/ci.yml/badge.svg)](https://github.com/sanpii/explain/actions?query=workflow%3A.github%2Fworkflows%2Fci.yml)
[![Build Status](https://gitlab.com/sanpi/explain/badges/main/pipeline.svg)](https://gitlab.com/sanpi/explain/commits/main)Transform postgresql explain to a graph.
[](https://raw.githubusercontent.com/sanpii/explain/main/examples/plan_1.png)
[](https://raw.githubusercontent.com/sanpii/explain/main/examples/plan_2.png)
[](https://raw.githubusercontent.com/sanpii/explain/main/examples/plan_3.png)
[](https://raw.githubusercontent.com/sanpii/explain/main/examples/plan_4.png)
[](https://raw.githubusercontent.com/sanpii/explain/main/examples/plan_5.png)
[](https://raw.githubusercontent.com/sanpii/explain/main/examples/plan_large.png)
[](https://raw.githubusercontent.com/sanpii/explain/main/examples/plan_parallel.png)
[](https://raw.githubusercontent.com/sanpii/explain/main/examples/plan_trigger.png)## Install
[![Packaging status](https://repology.org/badge/vertical-allrepos/explain.svg)](https://repology.org/project/explain/versions)
If you use Arch Linux, explain is available in
[AUR](https://aur.archlinux.org/packages/explain/).### Manually
```bash
git clone https://github.com/sanpii/explain
cd explain
make
sudo make install
```## Launch
Launch this program like `psql` and use `dot` to generate image:
```
$ explain --command 'select 1' database | dot -Tpng > explain.png
``````
$ explain --help
explain 1.0.0USAGE:
explain [FLAGS] [OPTIONS] [dbname]FLAGS:
--analyse this option executes explain analyse /!\ Be carful, that executes the query!
-n, --dry-run Don’t execute the query, the input is already an explain plan in JSON
--help Prints help information
-W, --password Prompt for a password before connecting to a database
-V, --version Prints version informationOPTIONS:
-c, --command Specifies the command to execute
-f, --file Read commands from the file, rather than standard input
-h, --host Specifies the host name of the machine on which the server is running
-o, --output Put output into file
-p, --port Specifies the TCP port on which the server is listening for connections
-U, --user Connect to the database as the userARGS:
Specifies the name of the database to connect to
```