Known Issue for not being able to deletg Big Objects with database.deleteImmediate still open. This is the only method mentioned in docs to do this. Workaround to delete 1 X 1 is a joke.

Any other straightforward methods to delete multiple records (10000 at a time) in a Big Object until the KI is fixed, without dropping and recreating the object since that can cause dependency issues?

  • Have you tried to use a Batch for this? – Patlatus Mar 29 '20 at 17:31
  • Strange, standard method works for me. – Patlatus Mar 29 '20 at 18:05
  • I think it is related to the Index. We experience the same issue. One of our indexed fields is on descending order. @Patlatus do you have any indexed field in descending order? – kvor Mar 30 '20 at 17:08
  • @kvor, yes, I have created an index including two fields: one ascending and one descending and I cannot reproduce this issue – Patlatus Mar 30 '20 at 17:41

This seems strange, but in fact I cannot reproduce your issue.

However, if I were able to reproduce this issue, I would solve this by using a Batch.

public class DeleteBatch implements Database.Batchable<SObject>, Database.Stateful {
    public final String Query;

    public DeleteBatch ( String q ) {
        Query = q;

    public Iterable<SObject> start( Database.BatchableContext bc ) {
        return Database.query(query);

    public void execute( Database.BatchableContext bc, SObject[] scope ) {

    public void finish( Database.BatchableContext bc ) {



Database.executeBatch(new DeleteBatch('select Son__c, Daughter__c from Big_Mommy__b'));

However, for me even simple statement

Database.deleteImmediate([select Son__c, Daughter__c from Big_Mommy__b]);

executes successfully, so I am unable to verify if batch works for you. But in batch you can set batch size for example

Database.executeBatch(new DeleteBatch('select Son__c, Daughter__c from Big_Mommy__b'), 1);

to execute one record at a time.

Or you could modify my execute statement

public void execute( Database.BatchableContext bc, SObject[] scope ) {
for (SObject record:scope)

I think at least one of these options should work for you.

  • Using Database.executeBatch(new DeleteBatch('select Son__c, Daughter__c from Big_Mommy__b'), 1); in a big object, could lead to Asynchronous Apex method execution limit (250k per 24h). – kvor Mar 30 '20 at 17:05
  • I think CPU time limit might be exhausted first. However, the task here is to provide a way to delete big object records – Patlatus Mar 30 '20 at 17:38
  • How CPU time limit will happen will happen? Limits will reset after each execution of execute(). One possible limit to reach is the 250k batch apex execution if you want to delete couple hundred thousand records (if scope == 1). – kvor Mar 30 '20 at 19:45
  • It looks like the solution is that even though the Known Issue is still open, the original method, outlined by Salesforce and put here using Database.deleteImmediate now works again. – ddeve Apr 7 '20 at 1:15
  • Ok, cool. So Salesforce has fixed internally something. – Patlatus Apr 8 '20 at 12:22

If you are forced to process one record at a time, then you should just iterate over collection since there are no Gobernor Limit on execution of Database.deleteImmediate method

 for (SObject record:[select Son__c, Daughter__c from Big_Mommy__b)
  • This is a pattern that you should avoid: you will hit 150 DML limit – kvor Mar 30 '20 at 17:06
  • 1
    @kvor actually p-p is right: Database.deleteImmediate method execution is not counted in 150 DML limit – Patlatus Mar 30 '20 at 17:42
  • @Patlatus My bad. You are both right. It does not count (just confirmed it). – kvor Mar 30 '20 at 19:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.