add a faster implementation of batch insert.