Fork me on GitHub
#datascript
<
2017-04-07
>
Niki08:04:22

@misha wrong results or just slow?

Niki08:04:34

expect it to be slow, as there’s no index for such queries

misha09:04:59

@tonsky wrong results. also see example output exception in code snippet (with reordered :where clauses)

misha09:04:53

on large dataset rule-based query gives correct results, where _ based one - does not:

(let [rules '[[(has-property ?p ?e) [?e :foo/properties ?p]]
              [(has-property ?p ?e) [?e :bar/properties ?p]]]])

misha09:04:35

I could neither find any anomalies in my data, nor shrink it to reproduce false-positives in [?e _ ?p] query

misha09:04:02

my db has retracted entities, so that somehow might be relevant (gaps in indexes or whatever).

petterik09:04:49

@misha Shouldn't the values in your ds/transact! for :foo/properties and :bar/properties be vectors?

petterik09:04:02

since they are cardinality/many

misha09:04:11

afaik - no

petterik09:04:57

I just tried it, gives me the same result

misha09:04:52

generated datoms are exactly the same

misha09:04:45

cardinality/many affects the result of subsequent transactions: one: replaces value, many: adds another one

Niki10:04:25

Would be hard to fix without reproduceable test case

Niki10:04:36

Can you share the one you have maybe?

Niki10:04:08

Also please create an issue on github, I'll forget about it otherwise