 (defn- group-by-relation [accesses]
   (apply merge-with concat
          (map
-           (fn [l] (group-by #(get % "Relation Name") l))
+           (fn [l] (group-by #(get % index-access-identifier) l))
            accesses)))
 
 (defn- diff-relation-access [access-by-relation]

                opts (json/read-str (first lines) :key-fn keyword)
                plans (partition
                        (plans-per-query opts)
                        (mapcat json/read-str (rest lines)))
                parse-result (analyze-plans-for-all-queries plans)]
            (log/info "Analyzing plans found in" (first args) "which has options" opts)
            (save-parse-result file-name parse-result)))))))

  (* (count (:samplesizes opts))
     (:repetitions opts)))

(def index-access-identifier "Alias")
(def relation-accesses (atom []))

;; Not the best solution, but the easiest in this case
(defn- save-if-relation-access [o]
  (if (and (map? o) (contains? o index-access-identifier))
    (swap! relation-accesses conj o))
  o)

