"_" as a wildcard for attribute produces false positives on large dataset.
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 20/100
Research direction
Start by reducing the reported schema and query to a reproducible case, using the 60k+ datom dataset shape and checking whether retracted entities matter. Compare the wildcard _ query behavior with the discussion linked in the issue and issue #214. Done means the false positives are reproduced and a regression test demonstrates the corrected result set.
Written by the indexing model from the issue text.
Description
I don't have minimal reproducible case yet (db size I see this with is 60k+ datoms).
"False positives": some property entities are included in result set.
Issue is not reproducible with the following snippet, but schema and query have this shape:
(let [conn (ds/create-conn
{:bar/properties {:db/valueType :db.type/ref
:db/cardinality :db.cardinality/many}
:foo/properties {:db/valueType :db.type/ref
:db/cardinality :db.cardinality/many}
:property/attribute {:db/valueType :db.type/ref}
:attribute/name {:db/unique :db.unique/identity}})]
(ds/transact! conn [{:db/id -1 :attribute/name "A"}
{:db/id -2 :foo/properties {:db/id -21 :property/attribute -1}}
{:db/id -3 :bar/properties {:db/id -31 :property/attribute -1}}])
(->>
(ds/q '[:find [?e ...]
:in $ ?a
:where
[?p :property/attribute ?a]
[?e _ ?p]]
@conn 1)
(ds/pull-many @conn '[*])))
https://clojurians-log.clojureverse.org/datascript/2017-04-06.html
https://clojurians-log.clojureverse.org/datascript/2017-04-07.html
[org.clojure/clojurescript "1.9.229"]
[org.clojure/clojure "1.8.0"]
[datascript "0.15.5"]
might be related:
- actual dataset has retracted entities
- https://github.com/tonsky/datascript/issues/214
- Dominant language
- Clojure
- Stars
- 5.8k
- Forks
- 318
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from tonsky/datascript
-
Difficulty 4/5 3-5 days Newbie friendliness 42/100
tonsky/datascript#498 · 1 comment ·
-
Difficulty 5/5 Over a week Newbie friendliness 10/100
tonsky/datascript#489 ·
-
Stack overflow when transacting :db.type/tupleAttrs with a :db.type/ref attr through :db.fn/call Open
Difficulty 4/5 3-5 days Newbie friendliness 35/100
tonsky/datascript#483 · 2 comments ·
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
tonsky/datascript#470 · 1 comment ·
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
tonsky/datascript#441 · 1 comment · 3 reactions ·
All issues in tonsky/datascript
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
-
.Team/Metabot Priority:P3
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
needs triage
Difficulty 1/5 Under an hour Newbie friendliness 90/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
scalar-labs/scalar-jepsen#222 · 1 comment ·