|
1 |
| -# pginsight |
2 |
| -CLI tool to easily dig deep inside your Postgresql database. |
| 1 | +# PGInsight |
| 2 | +CLI tool to easily dig deep inside your PostgreSQL database. |
| 3 | + |
| 4 | +# Features |
| 5 | +- Index usage |
| 6 | +- Find unused indexes |
| 7 | +- Find duplicate indexes |
| 8 | +- Disk usage for every database |
| 9 | +- Disk usage for all tables in a given database |
| 10 | +- Cache hits ratio for a given database |
| 11 | +- Cache hits per table |
| 12 | +- Find slow queries |
| 13 | +- Self-contained binary, no dependencies |
| 14 | + |
| 15 | +# Installation |
| 16 | +- **Step 1**: Download binary from https://github.com/lafikl/pginsight/releases |
| 17 | +- **Step 2**: There's no step 2! |
| 18 | + |
| 19 | +# Usage |
| 20 | +``` |
| 21 | +Usage: |
| 22 | +PGINSIGHT_DBURL="postgres://username:password@localhost/dbname?sslmode=disable" ./pginsight <cmdname> [subcommand] |
| 23 | +
|
| 24 | +Commands: |
| 25 | + index usage |
| 26 | + Shows which indexes are being scanned and how many tuples are fetched |
| 27 | + index unused |
| 28 | + Shows the indexes which haven't been scanned |
| 29 | + index duplicate |
| 30 | + Finds indexes which index on the same key(s) |
| 31 | +
|
| 32 | + disk db |
| 33 | + Shows disk usage for all databases accessible from the configured user |
| 34 | + disk tables |
| 35 | + Show disk usage for all tables in the configured database |
| 36 | +
|
| 37 | + cache total |
| 38 | + Shows the total number of cache hits in the database |
| 39 | + cache tables |
| 40 | + Breakdown of cache hits per table |
| 41 | +
|
| 42 | + queries |
| 43 | + Shows the slowest 10 queries. |
| 44 | +``` |
| 45 | + |
| 46 | + |
| 47 | +# Example |
| 48 | +PGINSIGHT_DBURL="postgres://klafi:eee@localhost/test?sslmode=disable" ./pginsight queries |
| 49 | + |
| 50 | + |
| 51 | +# License |
| 52 | +The MIT License (MIT) |
| 53 | + |
| 54 | +Copyright (c) 2016 Khalid Lafi |
| 55 | + |
| 56 | +Permission is hereby granted, free of charge, to any person obtaining a copy |
| 57 | +of this software and associated documentation files (the "Software"), to deal |
| 58 | +in the Software without restriction, including without limitation the rights |
| 59 | +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
| 60 | +copies of the Software, and to permit persons to whom the Software is |
| 61 | +furnished to do so, subject to the following conditions: |
| 62 | + |
| 63 | +The above copyright notice and this permission notice shall be included in all |
| 64 | +copies or substantial portions of the Software. |
| 65 | + |
| 66 | +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| 67 | +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 68 | +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
| 69 | +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
| 70 | +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
| 71 | +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
| 72 | +SOFTWARE. |
0 commit comments