     (client/execute cluster (client/render-query query))))
 
 (defn get-tattr [cluster k name time]
-  (let [[bucket hitime] (take 2 (decode-time time))]
-    (mapcat
+  (let [[bucket slot] (decode-time time)]
+    (map
      (fn [row]
-       (map
-        (fn [[lotime value]]
-          [(encode-time bucket (:hitime row) lotime) (f/binary-to-bytes value)])
-        (:data row)))
+       [(encode-time bucket (:slot row)) (f/binary-to-bytes (:data row))])
      (select cluster
              :t_attr
-             (columns :hitime :data)
-             (where :key k :name name :bucket bucket :hitime [:>= hitime])))))
+             (columns :slot :data)
+             (where :key k :name name :bucket bucket :slot [:>= slot])))))
 
 (defn del-tattr [cluster attrs]
   (let [query (->> attrs

    (create-table
     cluster :t_attr
     (if-not-exists)
     (column-definitions {:key :uuid :name :varchar :bucket :bigint :hitime :int :data (map-type :int :blob) :primary-key [[:key :name :bucket] :hitime]})
     (with {:compaction {:class "LeveledCompactionStrategy" :sstable_size_in_mb "128"}})))
  (when-not (describe-table cluster keyspace :k_attr)
    (warn "creating table k_attr")


(defn fmt-del-tattr [data]
  (if (contains? data :time)
    (let [[bucket slot] (decode-time (:time data))]
      [(delete-query
        :t_attr
        (where :key (:key data)
               :name (:name data)
               :bucket bucket
               :slot slot))])
    (fmt-del-index :t_index {:key (:key data)
                             :name (:name data)})))

