No, currently the logic just checks that any one of the access patterns is satisfied. Do you have a dependent join scenario?
> Do you have a dependent join scenario?
From a brief spelunking through the code, it appears that the relevant logic is in RulePlanJoins. I think that if we can maintain the ordered list of access patterns, I can influence the planner's decision by creating the metadata in my preferred order. Does that seem right to you?
There is a sort in org.teiid.query.optimizer.relational.rules.RulePlaceAccess.addAccessPatternsProperty(PlanNode, QueryMetadataInterface) that appears to be the culprit here. Is that sort necessary? Can I change the sorting logic in AccessPattern.compareTo?
> Is that sort necessary? Can I change the sorting logic in AccessPattern.compareTo?
No I don't think that the sort is necessary any more.
However I'm not sure if that will help out. The join logic should just be forming the dependent join based upon all of the equi-join predicates. The only time we consider less is when there is a key relationship.