Based on best practices following is a quote from the reference link
In case of scenario where we have a definite path to lookup (e.g. /content/geometrixx/home/, under home say we have 500 pages). We can follow following approaches
They stated when the node set is small it may better to iterate through the JCR Nodes. A larger node set, its much better to set up OAK indexes and query. See [1], [2]