https://github.com/samr1/pg_stats
https://github.com/samr1/pg_stats
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/samr1/pg_stats
- Owner: SamR1
- License: mit
- Created: 2018-08-27T13:08:20.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2018-08-29T06:49:41.000Z (almost 7 years ago)
- Last Synced: 2025-01-09T13:58:05.279Z (5 months ago)
- Language: Python
- Size: 3.91 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# pg_stats
simple script to export slowest queries on PostgreSQL database in csv file.## Prerequisites
`pg_stat_statements` must be loaded (see [PostgreSQL documentation](https://www.postgresql.org/docs/10/static/pgstatstatements.html)).
## Usage
```shell
$ python pg_stats.py -h
Usage: pg_stats.py [options]Options:
-h, --help show this help message and exit
-n LIMIT, --number=LIMIT
Number of fetched slowest queries. Default: 20
-d DATABASE, --database=DATABASE
Database name. If incorrect or not found, no filter on
database. Default: None
-f FILE, --FILE=FILE Output file with extension. Default: output.csv```