datascript 2017-04-07

@misha wrong results or just slow?

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

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

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]]]])

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

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

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

since they are cardinality/many

I just tried it, gives me the same result

generated datoms are exactly the same

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

👍 1

Would be hard to fix without reproduceable test case

Can you share the one you have maybe?

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