MySQL query optimization
Problem
A query can become slow as data grows or filters change. The problem may appear in a screen, a process, or a report.
Analysis
I reproduce the case and identify the query first. Then I review filters, relationships, indexes, and, when needed, the execution plan. The question is which part of the flow explains the problem, not which recipe to apply.
Solution
The solution may be simplifying the query, adjusting indexes, or reviewing how information is requested. The change should preserve the expected result.
Validation
I compare behavior with representative data and scenarios. I review response time, result correctness, and effects on related processes.
Result or learning
Learning: useful optimization starts with data from the problem. Measuring before and after prevents an incidental change from looking like a solution.