How would you optimize a complex SQL query containing multiple joins and subqueries for a large clinical dataset at Amgen?