How would you optimize a slow-running SQL query that handles large datasets?
Anonimo
I would optimize the SQL query by adding appropriate indexes, reviewing the execution plan with EXPLAIN, minimizing selected data, and using partitioning or window functions where necessary.