[Fixed]-Modeling Aggregate Weight of Parts that are Composed of Parts.

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,

Database Structure for Tree Data Structure

👤liuyu

Leave a comment