Reduce the amount of database access for HAVE_PRI_SERVICE_MESSAGES.