More efficient processing of db inserts