This page is original PmaControl documentation. It keeps a practical index structure for MySQL optimization work, without copying third-party content or depending on an external product.
Reading
Slow queries are not always the most expensive. A medium query executed thousands of times can dominate workload.
Method
- Start from a concrete query, metric, or incident.
- Read the plan with
EXPLAINorEXPLAIN ANALYZEwhen available. - Check cardinality, selectivity, join type, and temporary volume.
- Deploy a minimal correction.
- Measure the gain on the same workload interval.
Example
EXPLAIN SELECT *
FROM orders
WHERE customer_id = 42
ORDER BY created_at DESC
LIMIT 20;
A composite index (customer_id, created_at) can be relevant if this query is frequent and selective.