Making delete queries more efficient