optimize the baggingtable creation inplace