How would you optimize a slow-running SQL query that involves multiple joins on large telemetry datasets?