Do classification in the database.