Optimized database_functionality