--doc-traversal-mode works on the notion of preferred children which is computed using path fragments that form aggregate rules.
The idea is reading through aggregated paths should avoid keeping non useful nodes (for path being currently indexed) in memory.
But, currently, in case, say when there multiple preferred children - jcr:content, metadata, then an index defn indexing parent of a very deep tree root would try to read in the whole tree before concluding that it doesn't have preferred children
e.g. with preferred list - jcr:content and metadata and index looking for jcr:content indexing following structure
Currently, while looking for jcr:content, the code concludes that it doesn't exist only after reaching /some-sibling (or if number of children read of /path/being/indexed is >= num_preferred_children).