More database access optimizations.