     (throw (ex-info "Cannot construct a partition without a base tablet"
                     {:tablets tablet-ids})))
   (let [base (node/get-data store (:base tablet-ids))
-        records (vec (tablet/read base))]
+        base-records (vec (tablet/read base))]
     {:data/type :merkle-db/partition
-     :merkle-db.data/count (count records)
-     ::first-key (first (first (tablet/read base)))
-     ::last-key (first (last (tablet/read base)))
-     ::tablets (-> tablet-ids
-                   (->>
-                     (map (fn [[k id]]
-                            [k {:id id
-                                :fields (tablet/fields-present
-                                          (node/get-data store id))}]))
-                     (into {}))
-                   (update :base dissoc :fields))}))
+     :merkle-db.data/count (count base-records)
+     :merkle-db.data/families (partition-families store tablet-ids)
+     ::first-key (first (first base-records))
+     ::last-key (first (last base-records))
+     ::tablets tablet-ids}))
 
 
 


(s/def :merkle-db.data/count nat-int?)

; TODO: bloom filter for key membership

(s/def ::first-key key/bytes?)
(s/def ::last-key key/bytes?)

(s/def :merkle-db.data.partition.tablet/data merkle-link?)
(s/def :merkle-db.data.partition.tablet/fields (s/coll-of any? :kind set?))

(s/def ::tablets
  (s/map-of keyword? (s/keys :req-un [:merkle-db.data.partition.tablet/id]
                             :opt-un [:merkle-db.data.partition.tablet/fields])))

(s/def :merkle-db/partition
  (s/keys :req [:merkle-db.data/count
                ::start-key
                ::end-key
                ::tablets]))



;; ## Constructors

(defn from-tablets
  "Constructs a new partition from the given map of tablets. The argument should

        ; Update partition tablet map.
        tablets (->> records
                     (reduce (partial append-record-updates field->family) {})
                     (reduce (partial update-tablets! store f) (::tablets part)))
        part' (assoc part
                     :merkle-db.data/count (count (tablet/read (node/get-data store (get-in tablets [:base :id]))))
                     ::tablets tablets
