performance optimizations for mysql