Add batching of inserts into temporary tables to try to reduce heap requirements for import