There are two approaches you can take to expedite deletion. One of them is to delete 10,000 rows at a time so that the transaction log does not grow to a huge size. Based on some logic, you continue to delete 10,000 lines, until all lines fulfill the condition, they are deleted. This may, depending on your system, speed up the removal by 100 times.
Another approach is to create a partition in a table. You have to create a section scheme and function, and if all the lines that you delete are in the same section, say, the cost of sales per day, and then deleting the section will delete all the lines in the meta-operation, and this will only take a few seconds. Separation is not difficult, but you need to spend some time to properly configure the rolling window. This is more than an hour, but less than a week later.
source share