How would you optimize a slow-running SQL query that joins multiple large tables in a relational database?