Explain how you would optimize a slow-running SQL query that involves multiple large table joins and complex aggregations at Kin Insurance.