presto-main/src/main/java/io/prestosql/sql/planner/iterative/Memo.java/Memo/incrementReferenceCounts
class Memo:    private void incrementReferenceCounts(PlanNode fromNode, int fromGroup)
    {
        Set<Integer> references = getAllReferences(fromNode);

        for (int group : references) {
            groups.get(group).incomingReferences.add(fromGroup);
        }
    }