Reduce the number of copy operations in pivotRows