Optimize cascade deletion for better performance