Correct me if I am wrong, the FOR ALL ENTRIES may not be suspect here.
I believe it may be because you have lot of selections in one of the SELECT OPTIONS as Raymond have mentioned.
Go to the variant of the custom program and check if any of the SELECT OPTIONS have too many entries.
Cheers,
Shambu