code: private List<ColumnRelation> getIndexedColumnRelations(String tableAlias, String foreignTableAlias, Map<String, String> tableAliases, ColumnRelationsStorage columnRelations) {
          List<ColumnRelation> ret = new ArrayList<>();
          List<ColumnRelation> matchedRelations = columnRelations.getRelations(tableAlias, foreignTableAlias);
          boolean hasColumnRelations = !matchedRelations.isEmpty();
          if (hasColumnRelations) {
              matchedRelations.forEach(matchedColumnRelation -> {
                  for (ColumnRelation columnRelation : matchedColumnRelation.toList()) {
                      String leftTableName = tableAliases.get(columnRelation.getLeftTableAlias());
                      IndexSignature leftIndexSignature = new IndexSignature(leftTableName, Collections.singleton(columnRelation.getLeftColumn()));
                      String rightTableName = tableAliases.get(columnRelation.getRightTableAlias());
                      IndexSignature rightIndexSignature = new IndexSignature(rightTableName, Collections.singleton(columnRelation.getRightColumn()));
                      if (
                              !indexStorage.getSignatures().contains(leftIndexSignature) ||
                              !indexStorage.getSignatures().contains(rightIndexSignature)
                      ) {
                          return;
                      }
                  }
                  ret.add(matchedColumnRelation);
                  columnRelations.removeRelation(tableAlias, foreignTableAlias, matchedColumnRelation);
              });
          }
          return ret;
      }
docs: Later this can be relaxed e.g. for inner joins.