Audit database
audit_databaseRun a comprehensive PostgreSQL schema audit to identify performance risks, memory pressure, checkpoint inefficiencies, lock contention, and dead tuple bloat. It returns an overall health score, top issues, and actionable 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. Set fresh=true to bypass the cache and re-read live (e.g. after a schema change). 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 |
|---|---|---|---|
| fresh | No | ||
| 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 |