optimize the database manager