You need to sign in to do that
Don't have an account?
Sravana Sudheer
too many rows SOQL 50001 for 241actual records
Hi,
My SOQL Aggregate query returns 248 rows only but it is showing 50001 too many rows error. can anybody help me. Below is th debug logs which i found.
20:26:11.597 (4597606036)|SOQL_EXECUTE_BEGIN|[73]|Aggregations:0|select AVG(Case_Age__c) Caseage, COUNT(Id) Cnt, Program__r.Name progName, MAX(Program__c) progId from Case where Program__r.Name != null group by Program__r.Name limit 2000 20:26:13.019 (6019416719)|SOQL_EXECUTE_END|[73]|Rows:241
20:26:13.019 (6019464326)|EXCEPTION_THROWN|[73]|System.LimitException: Too many query rows: 50001
20:26:13.019 (6019747894)|SYSTEM_MODE_EXIT|false
My SOQL Aggregate query returns 248 rows only but it is showing 50001 too many rows error. can anybody help me. Below is th debug logs which i found.
20:26:11.597 (4597606036)|SOQL_EXECUTE_BEGIN|[73]|Aggregations:0|select AVG(Case_Age__c) Caseage, COUNT(Id) Cnt, Program__r.Name progName, MAX(Program__c) progId from Case where Program__r.Name != null group by Program__r.Name limit 2000 20:26:13.019 (6019416719)|SOQL_EXECUTE_END|[73]|Rows:241
20:26:13.019 (6019464326)|EXCEPTION_THROWN|[73]|System.LimitException: Too many query rows: 50001
20:26:13.019 (6019747894)|SYSTEM_MODE_EXIT|false
Please check in your code if loop is causing the recursion. You can also post the code so we can help you.
Thanks,
Pratik
As you have not shared the code I am not sure but what I can see is your query is an aggregation query which means the single row which you are getting is aggregation of 1 or more rows i.e. you are getting 241 rows as result but processing has been done on more then 50000 case records.
Let me know if you need more description.
Please mark the answer as Best Answer if you find it useful.
Regards,
Swayam
Please mark the answer as Best Answer if it really helped so that it will help others as well in future and close the question.