How would you optimize a slow-running SQL query that processes millions of rows of flight telemetry data for Airbus?