Fork me on GitHub
#datomic
<
2016-02-17
>
lboliveira01:02:18

Hi, I am trying write a parametrized query that returns n random elements. The following query works:

(d/q '[:find [(rand 10 ?m) ...]
                      :in $ 
                      :where [?m :cliente/name]]
                    db )
but this not:
(d/q '[:find [(rand ?n ?m) ...]
                      :in $ ?n
                      :where [?m :cliente/name]]
                    db 10)
ClassCastException clojure.lang.Symbol cannot be cast to java.lang.Number clojure.lang.Numbers.isPos (Numbers.java:96) Can somebody please point me what I am doing wrong? ty.

jimmy03:02:21

hi guys can we use isComponent on enum type ?

val_waeselynck08:02:29

@lboliveira: my guess is that Datalog is not dynamic about this

val_waeselynck08:02:59

you'll probably want to build the query data structure programatically as a workaround

lboliveira10:02:34

@nxqd: I think so. I am using without any issues.

jimmy10:02:21

@lboliveira: thanks for letting me know, I use datomic-schema, it does seem to have problem with component. I might just use plain datomic schema in the future then simple_smile

lboliveira10:02:03

@nxqd: i am using datomic-schema too:

(s/schema foo
             (s/fields
               [type :enum [:type-a :type-b] :component]
               [ref1 :ref]
               [ref2 :ref]))])

lboliveira10:02:11

and this works

lboliveira10:02:38

what is happening?

jimmy10:02:44

@lboliveira: cool, thanks. my mistake

jimmy10:02:58

I put :component between :enum and its values xD

kschrader15:02:27

can someone shed some light on how to interpret the MemoryIndexMB metric in Datomic?

kschrader15:02:57

ours bounces up and down like that everyday

kschrader15:02:05

not sure if it’s something to worry about

marshall15:02:55

@kschrader: MemoryIndexMB is the size of the ‘memory index’ - that is the part of the index with novelty that has not yet been incorporated into the disk index.

kschrader15:02:25

ok, that’s not how I read it

kschrader15:02:29

but it makes sense now

marshall15:02:29

@kschrader: I would expect that pattern. As the memory index size approaches the MemoryIndexThreshold, a background indexing job will incorporate that data into the disk index

marshall15:02:54

so the drops you see are likely right after the completion of an index job

kschrader15:02:04

perhaps the metrics table on the monitoring page could link out to the longer definitions in the docs

kschrader15:02:28

it’s not always clear how to interpret all of them

Ben Kamphaus15:02:32

@kschrader: noted, I can take a look at adding more links to the relevant sections that explain what the metrics correspond to.