Reduce database lock time during delete