Derive orders.item_count as count(lineitemsList)
Counts are useful as chid existence checks. For example, the item_count can be used in a (commit!) validation to ensure that orders have at least one lineitem.
The value of the attribute will be updated to reflect the count of the specified attribute in the child objects whenever necessary. This includes child objects being added to and removed from the parent object, as well as modifications to the children objects that change their qualification in the Count. Observe that count processing is triggered by changes to the child, as visible in the log.
A Count is not recalculated from scratch, but rather adjusted as necessary. For instance, when a new (qualifying) child is added to the parent, the Count attribute will be incremented by 1. This means that there is very little performance impact.
To maintain high performance (per the adjustment discussion above), count values are assumed to be correct on disk. So, if you define new counts on existing data, you need to initialize these for proper operation.
You can do that using SQL tools, like this.