analyze_db_health
Runs PostgreSQL health checks to detect invalid indexes, connection saturation, transaction wraparound, sequence exhaustion, replication lag, and low buffer hit rates.
Instructions
Analyzes database health. Here are the available health checks:
index - checks for invalid, duplicate, and bloated indexes
connection - checks the number of connection and their utilization
vacuum - checks vacuum health for transaction id wraparound
sequence - checks sequences at risk of exceeding their maximum value
replication - checks replication health including lag and slots
buffer - checks for buffer cache hit rates for indexes and tables
constraint - checks for invalid constraints
all - runs all checks You can optionally specify a single health check or a comma-separated list of health checks. The default is 'all' checks.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| database | No | Optional. Alias of the configured database to query. Omit it when the server has only one database configured. When several are configured this parameter is required - call list_databases first to learn the valid aliases. | |
| health_type | No | Optional. Valid values are: all, buffer, connection, constraint, index, replication, sequence, vacuum. | all |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |