Adds table optimize to database class.