Database abstraction optimizations.