guides/Docker.md in pghero-2.0.0 vs guides/Docker.md in pghero-2.0.1
- old
+ new
@@ -36,8 +36,30 @@
docker run -ti -e DATABASE_URL=... ankane/pghero bin/rake pghero:capture_query_stats
```
After this, a time range slider will appear on the Queries tab.
+## Historical Space Stats
+
+To track space stats over time, create a table to store them.
+
+```sql
+CREATE TABLE "pghero_space_stats" (
+ "id" serial primary key,
+ "database" text,
+ "schema" text,
+ "relation" text,
+ "size" bigint,
+ "captured_at" timestamp
+)
+CREATE INDEX ON "pghero_space_stats" ("database", "captured_at")
+```
+
+Schedule the task below to run once a day.
+
+```sh
+docker run -ti -e DATABASE_URL=... ankane/pghero bin/rake pghero:capture_space_stats
+```
+
## Credits
Thanks to [Brian Morton](https://github.com/bmorton) for the [original Docker image](https://github.com/bmorton/pghero_solo).