Fork me on GitHub
#datomic
<
2018-10-13
>
idiomancy17:10:49

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?

val_waeselynck18:10:04

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?

idiomancy18:10:25

this would be for reading only

idiomancy18:10:40

so, a materialized view

idiomancy18:10:52

that can be queried with datalog semantics

idiomancy18:10:23

the ideal optimization would be space complexity, honestly

idiomancy18:10:41

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

idiomancy18:10:42

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

val_waeselynck18:10:42

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

idiomancy18:10:45

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

idiomancy18:10:42

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.

dpsutton22:10:23

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

dpsutton22:10:52

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