As per the article Execution Governors and Limits
In a SOQL query with parent-child relationship subqueries, each parent-child relationship counts as an extra query. The row counts from these relationship queries contribute to the row counts of the overall code execution.
I have run the following code
for (Account acc : [
SELECT (SELECT Id FROM Orders), (SELECT Id FROM Opportunities), (SELECT Id FROM Contacts)
FROM Account
]) {
// to something
}
Below the governor limits overview after the run:
Number of SOQL queries: 1 out of 100
Number of query rows: 32512 out of 50000 ******* CLOSE TO LIMIT
Number of aggregate queries 3 out of 300
I have in total 32512 accounts on salesfroce which matches the number of fetched rows, the number of SOQL queries is one and it consumed 3 aggregate queries.
Questions
- Why the number of queries used and rows fetch did not increase? The number should be higher since I am using aggregate queries
- What they mean with "These types of queries have a limit of three times the number for top-level queries" (Article above)?