Recommend indexes
recommend_indexesIdentify large PostgreSQL tables that may benefit from indexing by analyzing sequential scan patterns. Returns recommendations with table stats and reasoning.
Instructions
Recommend tables that may benefit from indexing — large tables read mostly by sequential scan. Set fresh=true to bypass the cache and re-read live (e.g. after a schema change). Returns a list of objects with schema, table, live_tuples, sequential_scans, index_scans, and a reason explaining why the table is a candidate.
Example: recommend_indexes(min_live_tuples=10000)
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| fresh | No | ||
| database | No | Optional: target a configured secondary (read-only) database by name; omit for the primary. Call list_databases to see the configured ids. | |
| min_live_tuples | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |