Signs of Slow Queries

Symptoms: High CPU, slow page loads, 'Waiting for table lock' errors.

Identify Slow Queries

cPanel → Metrics → Resource Usage → MySQL tab → View slow query log.

phpMyAdmin Slow Query Log

Enable slow query log in MySQL configuration (host level).

Optimization Techniques

Add Database Indexes

Use EXPLAIN on slow queries → Add indexes on frequently filtered columns.

Optimize Tables

phpMyAdmin → Select database → Check all → Optimize table.

Cache Queries

Use Redis/Memcached object cache for WordPress.

Common Fixes Table

IssueFix
Missing indexesAdd INDEX on WHERE/ORDER columns
Large tablesOptimize and repair
No cachingEnable object cache
Bad queriesRewrite or add limits