Audit database
audit_databaseAudit a PostgreSQL schema's performance, health, and logs by scanning memory, checkpoints, contention, and dead tuples. Returns overall health score, top issues, and recommendations.
Instructions
Run a deep, comprehensive DBA-level database performance, logs, and health audit over the specified schema. Scans memory, checkpoints, temp file spills, contention locks, dead tuple cleanliness, and optionally scans custom logging tables. Returns an object with timestamp, database, version, overall_health ('GOOD' / 'WARNING' / 'CRITICAL'), health_score (int), categories (per-area results), top_issues, recommendations, and raw_stats_snapshot.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| schema | Yes | ||
| database | No | Optional: target a configured secondary (read-only) database by name; omit for the primary. Call list_databases to see the configured ids. | |
| log_table | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| version | Yes | ||
| database | Yes | ||
| timestamp | Yes | ||
| categories | Yes | ||
| top_issues | Yes | ||
| health_score | Yes | ||
| overall_health | Yes | ||
| recommendations | Yes | ||
| raw_stats_snapshot | Yes |