Reduce mysql memory use