WDYT about using QueryBuilder to construct the query. The thought being in-query path filters is slow; and IIRC in Oak it forces a traversal search (which has an upper limit).