Fork me on GitHub
#datomic
<
2017-12-25
>
mx200005:12:23

Hello, what kind of settings should I set for a server with only 1 GB or 512 MB of memory?

laujensen16:12:25

(defn get-visitors-with-activities
  [siteurl from to]
  (d/q '[:find [(pull ?vs [* {:visitor/activity [:activity/path :activity/note]}]) ...]
         :in $ ?siteurl ?from ?to
         :where
         [?s :site/url ?siteurl]
         [?s :site/visitors ?vs]
         [?vs :visitor/activity ?a]
         [?a  :activity/timestamp ?dt]
         [(.after ^java.util.Date ?dt ^java.util.Date ?from)]
         [(.before ^java.util.Date ?dt ^java.util.Date ?to)]         
         ]
       (db) siteurl from to))

souenzzo21:12:24

you can use [(> ?dt ?from)] inside datalog (although it does not work on clojure)

souenzzo13:12:49

Was there a time difference?

laujensen14:01:47

no afraid not

laujensen16:12:12

Hey guys, this is filtering a few 100ks of visitors and their activities, returning just 3500 maps, but taking 1500 msecs doing it. The same query would be around 3msecs in mysql. Whats choking my performance?