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
Jas JohlJas Johl 

Input on whether to soft or hard delete large data volumes, and the impact on the trash

NagendraNagendra (Salesforce Developers) 
Hi Jas,

The Salesforce data deletion mechanism can have a profound effect on the performance of large data volumes. Salesforce uses a Recycle Bin metaphor for data that users delete. Instead of removing the data, Salesforce flags the data as deleted and makes it visible through the Recycle Bin. This process is called soft deletion. While the data is soft deleted, it still affects database performance because the data is still resident, and deleted records have to be excluded from any queries.

The data stays in the Recycle Bin for 15 days, or until the Recycle Bin grows to a specific size. The data is then physically deleted from the database after 15 days; when the size limit is reached; or when the Recycle Bin is emptied using the UI, the API, or Apex. See View and Purge the Recycle Bin.

In addition, the Bulk API supports a hard delete (physical delete) option, which allows records to bypass the Recycle Bin and become immediately available for deletion. We recommend that you use the Bulk API’s hard delete function to delete large data volumes.

If you want to delete records in a sandbox organization’s custom objects immediately, you can try to truncate those custom objects. You can contact Salesforce Customer Support for assistance with this task.

For more information please check with below link: Hope this helps.

Regards,
Nagendra.