Performance improvement: Use bulk inserts into db