Print this page

Aggregate query has too many rows error

Knowledge Article Number 000002531
Resolution

This error happens when you're trying to use an aggregate function (like COUNT) on a query that has too many rows. To fix the error remove this condition:
 

for (childtype ch : Parent.children) {

//do some logic...

}

Alternatively, have a map of parent to child objects and get the size of each key from the map.

Example query that can cause the error:

if (parent.child.size() > 0)




promote demote