This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-02-25
Channels
- # aleph (1)
- # beginners (72)
- # boot (3)
- # cider (28)
- # cljs-dev (193)
- # cljsrn (11)
- # clojure (73)
- # clojure-brasil (3)
- # clojure-gamedev (2)
- # clojure-russia (6)
- # clojure-spec (30)
- # clojure-uk (26)
- # clojured (1)
- # clojurescript (32)
- # code-reviews (9)
- # core-async (4)
- # datascript (5)
- # datomic (9)
- # dirac (38)
- # fulcro (23)
- # garden (11)
- # leiningen (1)
- # luminus (11)
- # lumo (6)
- # off-topic (17)
- # quil (2)
- # re-frame (2)
- # reagent (3)
- # ring (3)
- # shadow-cljs (12)
- # spacemacs (4)
- # sql (2)
- # unrepl (85)
- # vim (3)
@captaingrover in general, whenever your system’s behavior does not match your expectations, I would recommend the scientific method https://www.youtube.com/watch?v=FihU5JxmnBg
@U072WS7PE Yeah, I wound up finding a couple of issues besides the n+1 just by removing different parts of the query and timing the result from the repl. For example, I was joining across attributes that were not :db/id
& :db.type/ref
. I probably should have know that would be slow but seeing the numbers makes it a lot more real. Good talk! Thank you!
that said, you can also improve your expectations in advance by creating SLAs, by modeling your system, and by generative and simulation testing
in your specific example, testing with simulated load would certainly uncover any n+1 roundtrip problem in a system
Watching the day of datomic video’s i’m somewhat confused by how were using Ids in the transaction to refer to other entities. https://vimeo.com/208663465#t=600s here is the code that stuart is referring to:
[{:person/name "bob"}
{:person/id "a"
:person/name "Alice"
:person/spouse "b"}]
Here i would assume what he is describing is how we can transact the idea that bob is married to alice without yet having an id for bob. i would expect that to look something like:
[{:person/name "bob"
:db/id "b"}
{:person/name "Alice"
:person/spouse "b"}]
@drewverlee I’m pretty sure you’re correct. Either that’s a typo or datomic is inferring from the fact that there are no other entities in the transaction.
Thanks @potetm. I assuming the schema also says that person/spouse is a ref. Also these docs on creating tempIds seem to indicate that the above (as i wrote it at least) would work: https://docs.datomic.com/on-prem/transactions.html#creating-temp-id
Is
(let [schema {:aka {:db/cardinality :db.cardinality/many}}
conn (d/create-conn schema)])
a shorthand for {ident {shema-key shema-value}}
as opposed to: (schema [{:db/ident :aka, etc…}]