MODE-2307 Corrected how subselects are used in dependent joins
MODE-2307 Indexes are now used when join conditions can be applied

Previously, index applicability only took into account constraints. So when an access query did not have any constraints (other than on jcr:primaryType or jcr:mixinTypes) then indexes were not considered, even though an index might apply to one of the selectors & properties on one side of the join condition.

With this change, it is now possible for the repository to try to apply indexes based upon constraints and/or join conditions. For example, an index on 'jcr:uuid' might apply to a SameNodeJoinCondition. Or, a property index might apply when an EquiJoinCondition involves that property.

Note that in these cases, join conditions have no literal values on which the index can filter its results, but it still can be used by returning all nodes in the index. This still might be significantly better than scanning the index.

It's even possible now that indexes might be applied based upon join constraints (additional constraints that apply to the join, and that cannot be pushed down to either side of the join).
Merge pull request #1251 from rhauch/mode-2307

MODE-2307 Corrected subqueries and variable substitution, and indexes may now be applied based on join conditions and join constraints