Improved performance on db