Fork me on GitHub
#datomic
<
2019-10-19
>
vemv07:10:33

'[:find [(pull ?u2 pe) ...]
  :in $ pe ?uuid
  :where
  [?u :user/uuid ?uuid]
  [?u :user/primary-email ?email]
  [?u2 :user/primary-email ?email]
  [?u2 :user/uuid ?uuid2]
  (not [(= ?uuid ?uuid2)])]
In this query, :user/primary-email is a :fulltext attribute, which degrades overall performance. How can I tweak the [?u2 :user/primary-email ?email] clause to use a strict = predicate?

vemv07:10:35

--- A simplified version of the question:

'[:find [(pull ?u pe) ...]
  :in $ pe ?email
  :where
  [?u :user/primary-email ?email]]
How do I skip the :fulltext querying here. (all other logic from the former query can be done in plain Clojure, out of the result of the simplified query)

favila16:10:11

There is no full text querying unless you use the fulltext function

favila16:10:06

Datalog joins are always exact match only

vemv19:10:59

that surprises me, since a single-clause query consisting of [?u :user/uuid ?x] takes 1ms, while a single-clause query consisting of [?u :user/email ?x] takes 80ms. In both cases, ?x is a fixed param I pass to the query. I imagined the difference is due to :fulltext being a part of my :user/email schema, but maybe there's some other explanation

vemv01:10:21

Debugged, this was indeed something else, related to indices. Solved now. Thanks for the pointer!

favila13:10:47

Did you not have a normal :db/index true on the :user/email attribute?

vemv13:10:30

We believed we had indices in place, but there was some issue with the tooling that emitted these indices. So these attributes stayed in their default of false