Fork me on GitHub
#datomic
<
2020-02-11
>
odie16:02:03

Hi there, I'm having a bit of trouble with a simple query I'm trying to write using the pull syntax. Some entities has an attribute that looks like

{:db/ident :some-component
   :db/valueType :db.type/ref
   :db/cardinality :db.cardinality/many
   :db/isComponent true}
This particular attribute often holds a list of some 2000+ elements. So, pull seems to want to return 1000 elements by default. To lift the limit, I tried the following...
(pull ?e [* (:some-component :limit nil)]) ;=> limit not lifted, returned 1000 elements
  (pull ?e [* (limit :some-component nil)]) ;=> limit not lifted, returned 1000 elements
  (pull ?e ["*" (:some-component :limit nil)]) ;=> limit not lifted, returned 1000 elements
  (pull ?e ["*" (limit :some-component nil)]) ;=> returned all 2184 elements
So, of the 4 cases, only the last one returns the correct number of elements. But, by using "*", all the key names seem to have been converted to strings.

odie16:02:41

What am I doing wrong here?

favila17:02:06

Sanity check: does your version of datomic support this syntax? it was added in on prem in version 0.9.5656

favila17:02:32

If that checks out, does removing the wildcard change behavior?

ghadi17:02:05

I believe there is a bug that @U05120CBV filed around this

marshall17:02:54

That's correct. We are working on a fix

odie19:02:05

@U09R86PA4 I'm using 0.9.6014.

odie19:02:33

Okay. Got it. It's a bug. Anybody got a link to that issue so I can keep an eye on it?

favila17:02:42

Can the datomic backup process make use of valcache or memcached?

marshall17:02:13

I dont believe that it does, but i will check

thanks3 4
favila15:02:58

Did you find anything out?

marshall15:02:49

It does not currently; can you provide more detail on use case? Is this a performance thing or robustness or other? Do you have specific quantitative requirements (i.e. speed/throughput/etc)?

favila15:02:22

It’s performance. We run a continuous backup and we were wondering if this was worth trying to get backup times under 1hr after an index event. By my reasoning it wouldn’t help much though because it’s already pruning the tree.

favila15:02:42

so it’s unlikely to be reading cached segments