Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

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

  • Loading branch information...
commit b06557a6ad4b39febc82ea4531bb2125e3421556 1 parent fd6667b
@Chouser Chouser authored
Showing with 4 additions and 1 deletion.
  1. +4 −1 src/leiningen/voom/pldb.clj
View
5 src/leiningen/voom/pldb.clj
@@ -26,7 +26,10 @@
The reldata is smaller than the database because it has no indexes."
[db]
(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
Please sign in to comment.
Something went wrong with that request. Please try again.