Do commits while grouping records to ensure that the grouped_work table does not become locked