Apex now supports in API versions 61.0 and later SOQL relationship queries that traverse up to five levels of parent-child records (the parent root as the first level of the query and child relationships up to four levels deep from the parent root). Each parent-child relationship subquery counts towards the number of aggregate queries processed in an SOQL query statement. The following aggregate methods are available:
- Limits.getAggregateQueries(), track the number of aggregate queries processed in an SQL statement
- Limits.getLimitAggregateQueries(), returns a value of 300, which is the total number of aggregate queries that can be processed with SOQL query statements

