Database performance improvements