You need to sign in to do that
Don't have an account?
fcomdeveloper
Overcome governor limits in aggregate SOQL queries
How can we overcome governor limits in aggregate SOQL queries
function readOnly(count){ }
You need to sign in to do that
Don't have an account?
How can we overcome governor limits in aggregate SOQL queries
You can't
all you can do is optimize your queries using where conditions.
You can increase the limits by using batch apex
it's even worse if you are using GROUP BY or GROUP BY ROLLUP. These aggregate query types do not support filtering with a WHERE clause. And HAVING filters can only include filtering on he value of the aggregate function (not on field values), so the number of rows included in the query can easily exceed governor limits.
Also, GROUP BY and GROUP BY ROLLUP do not support QueryMore(), which I believe is employed by the batch apex engine, so there are problems there as well.
Please vote on this Idea to raise awareness of this problem: https://sites.secure.force.com/success/ideaView?id=08730000000hRqKAAU
Thanks,
Ron