I ran an export all on event records that returned about 7 million records. The export timed out around the 6 million mark. I went ahead and ran a hard delete on the 6 million records which ran successfully. I know many of the records were already in the recycle bin, but I want to clear them out of the org. I ran a query to check the count of the remaining event records which did correctly return approximately 1 million records remaining in the system.

I also checked the data storage and it correctly showed a significant drop in the event records with about 1M left. However, I went back to dataloader to export all the remaining event records and it keeps showing that it is exporting the full 7 million records? Is dataloader somehow retrieving cached records? I don't see how it is retrieving the 7 million records when the org correctly shows that those have been hard deleted? I should only be able to export the 1M records that are left in the system.

I cannot identify where these records are coming from. Are the 7 million records somehow queued for deletion and dataloader still is seeing them? Or is there some other issue going on?


1 Answer 1


This is by design and likely that way due to the multi-tenant nature of Salesforce where multiple orgs are sharing the same server space. Deleting data can be a costly operation (particularly if its a big delete across different indexes and tables), but also rarely a time-sensitive one. So data is marked for deletion and the system will get to it when its freed up.

Looking into data recovery in Salesforce, a deleted record is moved into the recycle bin and still accessible for a certain amount of time. If a record is purged from the recycle bin it can still be accessible via APIs until its actually purged from the database.

When records are purged from the recycle bin, they might still be visible through API until they are completely purged from the organization. Users with View All Data and API access can check for records in this state by using Export All in Data Loader, and filtering on isDeleted = True.

If you want to filter out records pending deletion, use a query like below:

FROM MyObject
WHERE IsDeleted = false

Salesforce also has a video example of this on YouTube.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .