1👍
Adjacent list (parent / children relationship) is one way of modeling tree structure, but it’s not the only way, and it can be inefficient in certain tree operations, such as sub-tree aggregation as in your example.
If performances is critical for your application, and the query pattern is read-intensive, consider using an alternative model such as nested set.
Possibly related question,
Source:stackexchange.com