Question: I have a database table with 33265902 (thirty-three million two hundred sixty-five thousand nine hundred two) records in it.

Much of this is made up of duplicates.

It is causing me issues as any website that queries this table is causing load on the server.

What makes this table unique is two fields, email\_address and job\_id

My question is what is the best way to delete all duplicates leaving one good record per field criteria.

What is the most efficient way to do this without killing the server.

Answer: 
You can use limit

DELETE FROM table
[WHERE conditions]
LIMIT row\_count

call this query every 5mins. Just limit to 10000 data or add a little bit more
This may help...

```
;WITH DuplicateData
AS(
SELECT *,DENSE_RANK() OVER(PARTITION BY email_address, job_id ORDER BY email_address, job_id ASC) [Rank]
FROM TableName
)
DELETE d
FROM DuplicateData d WHERE Rank > 1
GO

```

Check this: <https://stackoverflow.com/a/56982523/5496498>