Minor performance tweak for database