Fork me on GitHub
#datomic
<
2020-01-23
>
dazld13:01:41

is there a quicker way to count the number of datoms than

(count (map :a (d/datoms (d/since db #inst"2020-01-14") :aevt :some.ref/attr)))
?

dazld13:01:49

(for example)

dazld13:01:06

I see that it’s an iterable, but I couldn’t see a way to figure out if it can have a method called on it to return the size

dazld13:01:39

seq/map seem about the same in terms of time taken

dazld14:01:22

I guess these kind of bounded time questions would be better with the log..?

ghadi14:01:35

@dazld (d/db-stats)

dazld14:01:03

I don’t have that - is it a cloud thing?

ghadi14:01:16

it's on the client API

dazld14:01:36

sadly, not using that

ghadi14:01:34

Will defer to datomic support but if you're using on-prem, you probably have some data in the logs, or via the metrics callbacks https://docs.datomic.com/on-prem/monitoring.html (cc/ @jaret)

dazld14:01:27

it’s ok, not a monitoring thing - and yep, can see totals for datoms in cloudwatch.

dazld14:01:42

it’s more of a performance golf thing

grzm15:01:06

Not overly long ago, Cognitect provided an example of splitting a Datomic app into separate app and deployment repos: https://github.com/Datomic/ion-event-example-app https://github.com/Datomic/ion-event-example I'm interested in hearing any experience reports with people doing this. One thing I like about Datomic is the quick "commit and deploy" workflow, and am wondering whether I'd find the "commit in app, push to repo, update deploy repo with new hash, and deploy" process overly cumbersome.

eoliphant16:01:09

quick datalog question. I’ve a case where a user can have 0-N entities each describing a privilege, and I need to determine users who have a given priv, but no others. so more generically something like I want to find entities where values :a 1 where say :b 'X' and there are no other entities where :a 1 and :b <something other than X> I did the following, and it works fine, but it feels a little clunky and was just wondering if there might be a more succinct approach

(d/q '[:find ?person-id
       :in $ ?person-id
       :where
       [?e :egms.highest_assignment/customer_staff_id ?person-id]
       [?e :egms.highest_assignment/customer_assignment "PRINCIPAL_INVESTIGATOR"]
       (not-join [?e ?person-id]
         [?f :egms.highest_assignment/customer_staff_id ?person-id]
         [(!= ?e ?f)]
         [?f :egms.highest_assignment/customer_assignment ?role]
         [(!= ?role "PRINCIPAL_INVESTIGATOR")])]
  db 938629M)

grzm20:01:01

Does something like this work?