You need to sign in to do that
Don't have an account?
Understanding parent-child relationship Execution Limits
Apex Governor limit document states "In a SOQL query with parent-child relationship sub-queries, each parent-child relationship counts as an additional query. These types of queries have a limit of three times the number for top-level queries."
1) Referring to "In a SOQL query with parent-child relationship sub-queries, each parent-child relationship counts as an additional query." If i execute following query, the no of SOQL executed needs to be Three. Yet debug log shows me 1 Query (and not 3). Am I missing anything?
List<Account> a =[Select Id, (Select Id from Contacts),(Select Id from Cases) from Account];
2) Can someone elaborate more on what does "These types of queries have a limit of three times the number for top-level queries." means?
the SOQL is working fine in apex explorer so it might due to SOQL result limitation .
Hi Lie,
Yes I am aware that the query is fine, the question here is on what does the Apex Governor Limit "In a SOQL query with parent-child relationship sub-queries, each parent-child relationship counts as an additional query" MEANS.
The question is around understanding Governor limit, it is not about any issue.
Hi,
If you give limit in the SOQL ( eg limit 10 ), is the error still coming ?
Lie,
As I said earlier too, I am not facing any error. The point of discussion is how does Salesforce count such queries against Governor Limit i.e., what is the number of Queries executed when you execute any Parent Child Query.
Hi Chirag,
Did you figure it out? I am confused too, what document is trying to say by statement "In a SOQL query with parent-child relationship sub-queries, each parent-child relationship counts as an additional query."
Thanks,
Lakhan
Hi All,
I figured it out, nested queries have their own limit of 300 and they don't show up in debug log. Thanks...
Regards,
Lakhan