You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Now, start it and wait for a few minutes. To obtain a PostgresAI access token for your organization, visit https://console.postgres.ai (`Your org name → Manage → Access tokens`):
146
+
Now, start it and wait for a few minutes. To obtain a PostgresAI access token for your organization, visit `https://console.postgres.ai` (`Your org name → Manage → Access tokens`):
Copy file name to clipboardExpand all lines: workload_examples/single_index_analysis.md
+9-12Lines changed: 9 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,16 +1,16 @@
1
-
## workload example for single index analysis dashboard
1
+
## Workload example for single index analysis dashboard
2
2
3
3
This example prepares and runs a repeatable workload designed for the postgres_ai monitoring “Single index analysis” dashboard. It also shows how to deploy `pg_index_pilot`, generate controlled index bloat, and let `pg_index_pilot` automatically rebuild indexes when bloat exceeds the configured threshold during periodic runs.
4
4
5
-
### prerequisites
5
+
### Prerequisites
6
6
7
-
-Postgres instance
7
+
-PostgreSQL instance
8
8
-`pg_cron` extension available for scheduling periodic execution
9
9
-`pgbench` installed for workload generation
10
10
11
-
## prepare the dataset in the target database
11
+
## Prepare the dataset in the target database
12
12
13
-
Create a table with several indexes and populate 10 million rows in the target database (e.g., `workloaddb`). This schema uses `test_pilot` schema and `items` table.
13
+
Create a table with several indexes and populate 10 million rows in the target database (e.g., `workloaddb`). This schema uses the `test_pilot` schema and the`items` table.
14
14
15
15
```bash
16
16
psql -U postgres -d workloaddb <<'SQL'
@@ -54,7 +54,7 @@ select setval('test_pilot.items_id_seq', (select coalesce(max(id),0) from test_p
Replace placeholders with actual connection details for your target database (the database where workload and indexes live; in examples below it is `workloaddb`).
Behavior: when `index_pilot.periodic(true)` runs, it evaluates index bloat in the registered target database(s). If bloat for an index exceeds the configured `index_rebuild_scale_factor` at the time of a run, an index rebuild is initiated.
121
120
122
-
#
123
-
124
-
### run the workload with pgbench
121
+
### Run the workload with pgbench
125
122
126
123
Use two concurrent pgbench jobs: one generates updates that touch ranges of `id` and another performs point-lookups by `id`. This mix creates index bloat over time; when bloat exceeds the configured threshold during a periodic run, `pg_index_pilot` triggers a rebuild.
Let these processes run continuously. The updates will steadily create index bloat; every 20 minutes, `index_pilot.periodic(true)` evaluates bloat and, if thresholds are exceeded, initiates index rebuilds.
166
163
167
-
### monitor results
164
+
### Monitor results
168
165
169
166
- In the postgres_ai monitoring included with this repository, use:
0 commit comments