Browse files

Write relations by first index. Reduce db size by 40%

  • Loading branch information...
1 parent fd6667b commit b06557a6ad4b39febc82ea4531bb2125e3421556 @Chouser Chouser committed Dec 23, 2013
Showing with 4 additions and 1 deletion.
  1. +4 −1 src/leiningen/voom/pldb.clj
@@ -26,7 +26,10 @@
The reldata is smaller than the database because it has no indexes."
(for [[rel-name indexes] db]
- [rel-name (::pldb/unindexed indexes)]))
+ (if-let [min-index (and (< 1 (count indexes))
+ (apply min (filter number? (keys indexes))))]
+ [rel-name (mapcat seq (vals (get indexes min-index)))]
+ [rel-name (::pldb/unindexed indexes)])))
(defn from-reldata
"Returns a core.logic pldb for the given reldata (such as generated

0 comments on commit b06557a

Please sign in to comment.