JoinRegion joinRegion, CommandContext context) throws QueryMetadataException,
TeiidComponentException, QueryPlannerException {
//TODO: consider moving select criteria if it is preventing a join from being pushed down
//TODO: make the criteria checks based upon a guess at selectivity
Map accessMap = getAccessMap(metadata, capFinder, joinRegion);
boolean structureChanged = false;
//search for combinations of join sources that should be pushed down
for (Iterator accessNodeIter = accessMap.entrySet().iterator(); accessNodeIter.hasNext();) {
Map.Entry entry = (Map.Entry)accessNodeIter.next();
List<PlanNode> accessNodes = (List)entry.getValue();
if (accessNodes.size() < 2) {