This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-08-21
Channels
- # announcements (1)
- # babashka (39)
- # beginners (91)
- # cider (9)
- # clj-kondo (10)
- # cljsrn (1)
- # clojure (54)
- # clojure-europe (45)
- # clojure-italy (2)
- # clojure-nl (1)
- # clojure-spec (39)
- # clojure-uk (21)
- # clojurescript (7)
- # core-typed (1)
- # cursive (9)
- # data-science (1)
- # datomic (2)
- # docker (3)
- # emacs (11)
- # figwheel-main (11)
- # fulcro (19)
- # java (1)
- # juxt (1)
- # kaocha (68)
- # malli (7)
- # meander (5)
- # off-topic (76)
- # pedestal (1)
- # re-frame (6)
- # reveal (1)
- # rum (2)
- # shadow-cljs (48)
- # sql (6)
- # tools-deps (47)
- # vim (8)
- # xtdb (23)
Hey, I’m looking for some understanding, what makes this a much faster query:
(time (d/q '{:find [(count ?e)]
:where [[?e :person/last-name ?last-name]
[(>= ?last-name "A")]
[(< ?last-name "B")]]}
(d/db conn)))
Than this:
(time (d/q '{:find [(count ?e)]
:where [(or-join [?e]
(and [?e :person/last-name ?last-name]
[(>= ?last-name "A")]
[(< ?last-name "B")]))]}
(d/db conn)))
I’d say, these are the same queries right? Interestingly, before I added an index for :person/last-name
they were about as fast... as in, same speed as the or-join version now is➕ 3
I understand the or-join
is superfluous in this small example, I’m just wondering where this performance difference comes from