Recommend indexes
recommend_indexesRecommends indexing for large tables with high sequential scan counts, returning schema, table, and reason. Set fresh=true to bypass cache for live analysis.
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 |