Read autovacuum priority
read_autovacuum_priorityIdentifies tables at risk of autovacuum bloat by ranking them against per-table thresholds. Returns priority levels ('overdue', 'watchlist', 'borderline') and key metrics to explain why each table needs attention.
Instructions
Return the tables most urgently needing autovacuum, ranked by how close their dead-tuple count is to the per-table autovacuum threshold (autovacuum_vacuum_threshold + autovacuum_vacuum_scale_factor * reltuples, honouring per-table reloptions overrides). Each row carries priority ('overdue' if past the threshold, 'watchlist' if within 50%, 'borderline' otherwise) plus the inputs (n_dead_tup, vacuum_threshold, last_autovacuum, autovacuum_enabled) so the agent can explain why a table landed on the shortlist. Top-level overdue_count lets an agent branch without walking the list. Read-only catalog query.
Example: read_autovacuum_priority(limit=25)
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | 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. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| rows | Yes | ||
| detail | Yes | ||
| available | Yes | ||
| overdue_count | Yes | ||
| watchlist_count | Yes |