db performance improvements