Fork me on GitHub

hey, this is a data*script* so I apologize for asking it here, but there's a knowledge overlap and the datascript channel is deaaad. is anyone aware of any performance considerations/ best practices for building derived databases in datascript? For instance, would it be generally faster to do something like (db-with (empty-db) (d/q [:find (pull all entities I care about)])) or to do something with d/filter?


Well, this depends on how much you read compared to how much you write. How often do you need to create a derived database, and what performance expectations do you have when reading it?


this would be for reading only


so, a materialized view


that can be queried with datalog semantics


the ideal optimization would be space complexity, honestly


so a better solution would take up less memory than other available equivelant solutions


I'm not sure how possible that is for datascript though


Filtering has essentially no space cost, it just slows down queries a bit


oh really!? that's great, so it's sharing the structures from the reference value?


so its really just querying the same value with an additional predicate

Daniel Hines21:10:45

I'm trying to follow the Datomic on-prem tutorial in from a cider repl in emacs. When I eval (def client (d/client cfg)), I got the following error

Daniel Hines21:10:09

2. Unhandled clojure.lang.Compiler$CompilerException
   Error compiling datomic/client/impl/shared.clj at (349:13)

1. Caused by java.lang.RuntimeException
   Unable to resolve symbol: int? in this context

Daniel Hines21:10:47

Admittedly, I'm not sure whether this is a beginner, cider, or datomic question.


What's your clojure version. That's a 1.9 predicate


Any chance you're on 1.8 from lein new or some other reason?

Daniel Hines23:10:22

That's exactly what it was! Thanks @dpsutton