I want to delete 10 million records from the custom object. How to delete all records without batch class and within minimum time.
You can able to delete the custom object records by using Truncating feature without using apex code.
If you do not see Truncate button in the custom object, go to Setup | Customize | User Interface | Enable Custom Object Truncate
Truncating custom objects allows you to delete all of the object’s records permanently, but preserve the empty object and its metadata.
Truncating custom objects is a way to permanently remove all of the records from a custom object, while keeping the object and its metadata intact for future use. Truncating is useful, for example, if you have created a custom object and filled it with test records. When you’re done with the test data, you can truncate the object to purge the test records, but keep the object and put it into production. This is much faster than batch-deleting records and possibly recreating the object.
- Go to the object management settings for custom objects.
- Click an object name to go to the object’s detail page, and then click Truncate.
- In the Confirm Custom Object Truncate window, review the warning and then enter the name of the object to truncate in the empty field.
- Click Truncate.
Refer the help article before proceeding with truncating feature.