Skip to content
/ explain Public

Transform postgresql explain to a graph

Notifications You must be signed in to change notification settings

sanpii/explain

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

91 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Explain

Github actions Build Status

Transform postgresql explain to a graph.

Install

Packaging status

If you use Arch Linux, explain is available in AUR.

Manually

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.0

USAGE:
    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 information

OPTIONS:
    -c, --command <command>    Specifies the command to execute
    -f, --file <file>          Read commands from the file, rather than standard input
    -h, --host <host>          Specifies the host name of the machine on which the server is running
    -o, --output <output>      Put output into file
    -p, --port <port>          Specifies the TCP port on which the server is listening for connections
    -U, --user <user>          Connect to the database as the user

ARGS:
    <dbname>    Specifies the name of the database to connect to