function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Dhanasekar KDhanasekar K 

Find duplicates in custom object with large volume of records

Good morning All,

Can someone suggest me to find duplicate reocrds in custom object (which have more than 15 million reocods). I tried by using below query but it consumes more time and failing with CPU time limit exception.

List<AggregateResult> acc=[SELECT Name, count(Id) FROM Account GROUP BY Name HAVING count(Id)>1];

Now i am planning to create batch job find and update those records, but it has to be done by subset of records I guess. 

Can someone advise me "Is there any other way to achieve this?"

Thanks in advance !!!
Nubes Elite Technologies Pvt. LtdNubes Elite Technologies Pvt. Ltd
Hi Dhanasekar,

I suggest you to try Dataloader or Dataloader.io 

You can simply run a Salesforce report that includes the IDs of the records you want to delete, and then just run a delete job using either of those tools.

Thank You,
www.nubeselite.com
Development | Training | Consulting

Please mark this as solution if your problem is solved.
Raquib SFRaquib SF
Hello,

I believe the above identification of duplicated would be 1 step towards data-cleansing or data-merging. 

I would suggest to run standard report but to restrict the 1st report to say for names starting with A. That way you can have 26 reports which would be smaller in size and easier to handle.

Please let me know your thoughs.

Thanks!