Review tables, indexes and autovacuum
Review the physical health of your tables and indexes: bloat, missing or unused indexes, and whether autovacuum keeps up.
Ask the assistant to survey the tables and indexes of one instance over a past window and report what needs attention. One analysis covers four questions at once: which tables carry the most dead tuples (a bloat proxy), which large tables are read by sequential scans and would benefit from an index, which indexes look unused or redundant, and whether autovacuum keeps pace with the write load.
Nothing is executed on the database. The survey reads the table and index statistics the platform collects every hour, so it needs a time window rather than real-time access.
Example prompts
Bloat:
"Which tables are bloated on prod-eu-1 over the last 24 hours?"
"Give me the detailed stats of the orders table in the demo database on prod-eu-1."
Missing indexes:
"Any missing or unused indexes on prod-eu-1?"
"Why so many sequential scans on the billing database of prod-eu-2 this morning?"
Validate one index idea:
"Estimate whether an index on order_details(order_id) would change the delete's plan on prod-eu-1."
Autovacuum:
"Is autovacuum keeping up on prod-eu-1's zabbix database?"
"Is a vacuum or index build running on prod-eu-1 right now, and how far along?"
The named command is datasentinel tables, followed by the instance and the window. See the Skill commands reference. A question about a vacuum or an index build in flight routes to datasentinel maintenance instead, described under Look at live activity.
What the assistant looks at
The survey ranks tables and indexes on the axis that matches your question, then drills the one or two objects it flagged. Bloat is always assessed, whatever you asked: a clean bill is reported in one line rather than left out.
The windowed statistics carry no measured bloat figure. The assistant reads the dead-tuple count, the dead-to-live ratio, and the rows modified since the last analyze, and reports a high dead-tuple ratio (bloat proxy), never a percentage it cannot measure.
The exact figure needs a live look at the table, offered as a next step when your account has real-time access (see Live checks below).
Sequential scans are read against table size: many scans on a small table are fine, and the signature of a missing index is a large table with a huge number of rows read sequentially. Each suspect is a lead, not a verdict: the next step drills the query behind the scans and reads its captured plan, as in Optimize your top queries.
To validate one index idea before creating it, ask for the plan the planner would choose now, as in Explain execution plans. The assistant states the trade-off of every index it proposes: the reads it saves against the write cost it adds.
An index with no scans over the window appears unused over this window, and the recommendation is to investigate it for dropping, never to drop it. An index used only by a nightly or weekly job looks unused in a short window, so the verdict is always qualified by the window it was read over.
Redundant indexes are candidates only: usage statistics carry no index definitions, so confirming a duplicate, or measuring the bloat of an index, needs a live check. A low share of HOT updates on a heavily updated table points at write amplification by the indexes already in place.
"Vacuums are running and dead tuples are high" is not a diagnosis. The assistant reads the trend of dead tuples across the hourly samples, not a single count, and separates four causes:
Vacuums infrequent, dead rows high
Scale factor too coarse for a large table
Per-table vacuum scale factor or threshold
Vacuums completing, dead rows high, an old open transaction confirmed
Pinned cleanup horizon
End that session; no autovacuum setting helps
Vacuums completing, dead rows high but stable across samples
Steady-state churn, vacuum keeps pace
None; the level is reported and the case is closed
Vacuums completing, dead rows climbing sample over sample
Reclaim genuinely behind
Vacuum cost limit, cost delay, or worker count
A pinned horizon is never attributed without positive evidence of a holder. Confirming one needs a live look at the sessions, and even a clean session list cannot exclude it, because prepared transactions and replication slots are invisible to the assistant: those two stay flagged for an operator.
Depending on your communication style, the TECHNICAL style gives the parameter names and values to change, while the PLAIN style gives the same verdict as an escalation to raise with the database team, with no parameter names.
Live checks
Three follow-ups need real-time access, and the assistant offers them only when your account has it.
Exact bloat figure: a live read of one table returns its measured bloat, provided the
datasentinel_analyticsfunction is installed in the database. Without it, the live counters come back and the assistant says in one line that the measured part needs the function.Duplicate indexes and index bloat: the same live read confirms a redundancy candidate against the actual index definitions and measures the bloat of each index.
Maintenance in progress: a VACUUM, VACUUM FULL, CLUSTER, index build, ANALYZE, or COPY in flight, with its phase, how far along it is, and the cost it imposes while it runs.
Last updated