神刀安全网

A command-line GO Postgres query visualizer

gocmdpev

A command-line GO Postgres query visualizer, heavily inspired by the excellent (web-based)pev

A command-line GO Postgres query visualizer

Usage

go get github.com/simon-engledew/gocmdpev 

Generate a query plan with all the trimmings by prefixing your query with:

EXPLAIN (ANALYZE, COSTS, VERBOSE, BUFFERS, FORMAT JSON) 

Then pipe the resulting query plan into gocmdpev .

On MacOS you can just grab a query on your clipboard and run this one-liner:

pbpaste | sed 's/^/EXPLAIN (ANALYZE, COSTS, VERBOSE, BUFFERS, FORMAT JSON) /' | psql -qAt <DATABASE> | gocmdpev

Python 3 Bindings

Build:

go build -buildmode=c-shared -o pycmdpev.so pybindings/*
import pycmdpev  pycmdpev.visualize("<JSON EXPLAIN STRING>")

转载本站任何文章请注明:转载至神刀安全网,谢谢神刀安全网 » A command-line GO Postgres query visualizer

分享到:更多 ()

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址