Development questions
What is the governor limit for Aggregate queries and how do rows counted in AggregateResult contribute to the 50,000-row limit?
Aggregate queries still count toward the shared 50,000 total retrieved rows limit: the rows returned as AggregateResult objects (one per group) are counted. Also, aggregate queries can be costly because Salesforce scans the underlying records, and very large scans can time out.
Tips: add selective filters, use LIMIT, and verify consumption with Limits.getQueryRows() before and after the query in a debug test.
soqlaggregategovernor-limits
More Development questions
- What is an Apex Trigger in Salesforce and when should you use it over Flows?
- What is the difference between before triggers and after triggers?
- Explain all Trigger context variables (isInsert, isUpdate, isDelete, isUndelete, isBefore, isAfter, isExecuting, size, operationType).
- What is the difference between Trigger.new and Trigger.old?
- In which trigger events are Trigger.new and Trigger.newMap available?
- In which trigger events are Trigger.old and Trigger.oldMap available?