1. A computer-executed method for gathering statistics of a hierarchically-organized collection of resources comprising: in response to a change to a particular resource in the collection, including, in a data structure, a identifier for each container resource of a set of container resources that includes ancestor container resources of the particular resource; while traversing the collection to gather statistics for the collection: gathering statistics for resources that are immediate children of container resources, the identifiers of which are included in the data structure, to produce gathered statistics; skipping gathering statistics for resources that are immediate children of container resources, the identifiers of which are not included in the data structure; wherein the method is performed by one or more computing devices.