Optimize performance
This code/query is slow: [CODE/QUERY]. The context is [CONTEXT: data volume, environment]. Analyze possible performance bottlenecks and suggest concrete optimizations, explaining the expected gain from each one. Prioritize changes with the highest impact and lowest risk.