Supported Databases › MySQL
MySQL Performance Investigation with MCP Workflows
MySQL performance problems typically surface as slow queries, growing connection queues, or intermittent spikes that are hard to reproduce. DatabaseMCP provides a structured MCP-oriented investigation workflow for MySQL—covering InnoDB internals, Performance Schema data, and resource utilisation together rather than in isolation.
Common MySQL performance problems
- Slow query accumulation: Queries without adequate indexes, queries with large result sets, and queries that trigger full table scans show up in the slow query log and Performance Schema statement tables. High total execution time is often driven by a small number of query patterns.
- InnoDB lock contention: Row-level locking in InnoDB prevents concurrent modification of the same rows. Long-running transactions holding row locks block other writes. Deadlocks between competing transactions are logged in the InnoDB status and should be reviewed when they occur frequently.
- Buffer pool pressure: The InnoDB buffer pool caches data and index pages in memory. When the working set exceeds buffer pool size, disk I/O increases sharply. Buffer pool hit rate below 99% on production systems typically indicates undersized memory allocation.
- Connection limit saturation: MySQL's max_connections setting caps concurrent connections. Hitting this limit causes new connection attempts to fail with "too many connections" errors. Connection poolers reduce this pressure but introduce their own timeout and queue management considerations.
- Replication lag: In environments using binary log replication, write-heavy workloads or large transactions on the primary can cause replicas to fall behind. Reads from lagging replicas return stale data.
- Temporary table and sort pressure: Queries requiring large sorts or implicit temporary tables that spill to disk show up as high Created_tmp_disk_tables counts. These often indicate missing indexes or over-broad query result sets.
MCP investigation workflow for MySQL
- Performance Schema query digest: Identify top query patterns by total latency, execution count, and rows examined. High rows-examined-to-rows-sent ratios indicate index gaps.
- InnoDB status review: Check InnoDB lock waits, deadlock history, buffer pool hit rate, and pending I/O operations for a quick engine-level health summary.
- Active connection analysis: Review SHOW PROCESSLIST or Performance Schema threads for long-running queries, sleeping connections holding locks, and connection distribution across application hosts.
- Resource utilisation correlation: Map CPU, memory, and disk I/O metrics against query activity to identify whether bottlenecks are compute- or storage-bound.
- Replication health check: For replica deployments, review Seconds_Behind_Source and relay log position to assess replication health and lag trends.
Cloud MySQL coverage
The same investigation approach applies across self-hosted MySQL and managed cloud deployments. For cloud-specific guidance see:
Get started
See platform features on minidba.com