SQL Query Slow in Production but Fast in Staging