         o-plans (map #(order-plan % order) w-plans)]
     (least-by quantify-cost o-plans)))
 
-(defn- select-plan [db where order offset limit only]
+(defn- find-plan [db where order offset limit only]
   (-> (wo-plan db where order)
     (offset-plan offset)
     (limit-plan limit)

  (let [only (:only plan)]
    (map #(select-keys % only) (exec-source db plan))))

(defn- q-select [db {:keys [where order offset limit only]}]
  (exec db
    (select-plan db where order offset limit only)))

(defn- q-count [db opts]
  (count (q-select db opts)))

(defn- db-apply [db records apply-fn]
  (let [{old-rmap :rmap old-imap :imap} db

(defn- q-explain [db {[query-type opts] :query :as explain-opts}]
  (assert (= query-type :select))
  (let [{:keys [where order offset limit only]} opts]
    (find-plan db where order offset limit only)))

(defn- q-create-index [db {:keys [on where]}]
  (assert (not (on (:imap db))))
