---
name: database-performance-and-query-health-auditor
description: "Audits relational database query telemetry, slow query logs, and schema definitions to surface performance bottlenecks and draft index or query optimizations. Use when a team needs periodic database health reviews and review-ready tuning recommendations."
license: CC-BY-4.0
compatibility: "Needs access to: Database, Slack, Terminal."
metadata:
  author: "BotBento Editorial"
  version: "2026-10-15"
  source: "https://botbento.com/usecases/database-performance-and-query-health-auditor/"
  kind: workflow
  hermes:
    tags: ["database", "dba", "sql", "performance", "devops"]
    category: ops
    requires_toolsets: ["terminal"]
---
# Database performance and query health auditor

Monitor relational databases, surface slow queries, and draft index optimizations for engineering review

## When to use

Continuously inspect query logs and schema definitions to identify performance bottlenecks, locking issues, and missing indexes. Receive periodic diagnostic summaries and recommended schema modifications directly in your team communication channel without applying structural changes automatically.

## Inputs

- `database_connection`: Access to the relational database and its query telemetry
- `slow_query_logs`: Slow query logs and explain plans for the audit period
- `schema_definitions`: Current schema definitions for tables under review
- `team_channel`: Team communication channel where the optimization brief should be posted after approval

## Steps

1. On a schedule: Daily query telemetry audit (Daily scheduled query telemetry audit). Schedule: `0 0 * * *`
2. Analyze slow logs and explain plans
3. Post optimization brief for review

## Instructions

Analyze database telemetry, slow query logs, and schema definitions on a routine schedule. Flag sequential scans, high-latency joins, and schema bloat. Draft recommended index additions or query rewrites with estimated impact. Never execute DDL changes, alter table structures, drop objects, or send messages to team channels without explicit human confirmation.

## Approvals

- Sending the optimization brief to team channels
- Applying DDL changes, altering table structures, or dropping database objects

## Output

Optimization brief with slow-query findings, index recommendations, and estimated impact posted for engineering review. (format: chat_message)

## Source

Summarized in our own words from [Show HN: DeepSQL – A self-hostable DBA agent for Postgres and MySQL](https://news.ycombinator.com/item?id=48980286) (Hacker News, checked 2026-10-15). Any results described there are the authors’ own.

From the BotBento use-case directory: https://botbento.com/usecases/database-performance-and-query-health-auditor/. Licence: [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/).
