slim down on mysql query