def join_offset(entry)
      name, offset = entry[0], entry[1]

      # determine which subtuple of the collection contains the table
      # referenced in entry.
      subtuple = 0
      all_rels_below[0..all_rels_below.length-1].each_with_index do |t,i|
        if t.qualified_tabname == name
          subtuple = i
          break
        end
      end

      return subtuple, offset
    end
def join_offset(entry)
      name, offset = entry[0], entry[1]

      # determine which subtuple of the collection contains the table
      # referenced in entry.
      subtuple = 0
      all_rels_below[0..all_rels_below.length-1].each_with_index do |t,i|
        if t.qualified_tabname == name
          subtuple = i
          break
        end
      end

      return subtuple, offset
    end
calculate the position for a field in the result of a join:
 the tuple offset ("subtuple") and the attribute position within it
 ("offset")