How would you optimize a slow-running SQL query that joins multiple high-volume tables containing warehouse inventory logs for Meta Logistics?