README.md in pgdexter-0.1.4 vs README.md in pgdexter-0.1.5

- old
+ new

@@ -35,11 +35,11 @@ ## How to Use Dexter needs a connection to your database and a log file to process. ```sh -tail -F -n +1 <log-file> | dexter <database-url> +tail -F -n +1 <log-file> | dexter <connection-string> ``` This finds slow queries and generates output like: ``` @@ -60,26 +60,54 @@ 2017-06-25T17:52:22+00:00 Index found: ratings (user_id) 2017-06-25T17:52:22+00:00 Creating index: CREATE INDEX CONCURRENTLY ON "ratings" ("user_id") 2017-06-25T17:52:37+00:00 Index created: 15243 ms ``` -## Single Statement Mode +## Connection String -You can also pass a single statement with: +The connection string is a URI with the format: -```sh -dexter <database-url> -s "SELECT * FROM ..." ``` +postgresql://user:pass@host:5432/dbname +``` +To connect through a socket, just pass the database name. + +``` +dbname +``` + ## Options Name | Description | Default --- | --- | --- exclude | prevent specific tables from being indexed | None interval | time to wait between processing queries, in seconds | 60 log-level | `debug` gives additional info for suggested indexes<br />`debug2` gives additional info for processed queries | info log-sql | log SQL statements executed | false min-time | only process queries consuming a min amount of DB time, in minutes | 0 + +## Single Statement Mode + +You can pass a single statement with: + +```sh +dexter <connection-string> -s "SELECT * FROM ..." +``` + +## Examples + +Ubuntu with PostgreSQL 9.6 + +```sh +tail -F -n +1 /var/log/postgresql/postgresql-9.6-main.log | sudo -u postgres dexter dbname +``` + +Homebrew on Mac + +```sh +tail -F -n +1 /usr/local/var/postgres/server.log | dexter dbname +``` ## Future Work [Here are some ideas](https://github.com/ankane/dexter/issues/1)