Repository navigation
perf(executor): OPTIONAL with a filter on the right side's own variables on term ids (#11) - #177
Open
MathiasVDA wants to merge 10 commits into
Open
MathiasVDA wants to merge 10 commits into
MathiasVDA wants to merge 10 commits into
Conversation
A product of decimals with more than 18 digits after the point gave no value (oxsdatatypes refuses it). It is now the exact product, as Jena's BigDecimal product: a decimal when it fits 18 fraction digits, else the literal with all its digits, as a long quotient is.
…atdata-eu/tripletrail into claude/project-thread-n3oul3-2
…-n3oul3-2 # Conflicts: # CHANGELOG.md # crates/tripletrail/tests/id_rows.rs # docs/store.md
…les on term ids (#11)
…atdata-eu/tripletrail into claude/project-thread-n3oul3-2
…s answered on ids (#11)
…-n3oul3-2 # Conflicts: # docs/server.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What and why
#11, the second gap noted in #172.
OPTIONAL { ?o ex:qty ?q FILTER(?q > 90) }is a left join with a filter, and the id executor sent it to the evaluator whole.SPARQL evaluates that filter on the merged row (left plus right). It equals the right side's own filter when every variable it reads is in one of two groups:
In that case
Eval::evalnow filters the right table with the usual filter kernels and then left-joins. Other filters, such asFILTER(?x > ?y)with?yfrom the left, give up as before. The check is on the tables (maybecolumns), not on the algebra, so a right side whose variable may be unbound (a nestedOPTIONAL) is handled correctly.direct::coveredaccepts aLeftJoinwhose expression the filter kernels cover.How it was tested
tests/id_rows.rsBINDS has six new cases, each compared with the evaluator:?swith&&;!BOUND(?x)of a nestedOPTIONAL's variable;ORDER BYandLIMIT;tests/counts.rs:?s a ?c OPTIONAL { ?s ex:feat ?f FILTER(?f != ex:f1) }is now counted on ids under both executors, and its counts match the rows'. Its assertion now expects ids.FILTER(?f != ?c), reads a left variable and expects the evaluator.Full
tripletrailsuite under the default executor: all pass. Oracle with ids as the default: all pass, apart from the two known plan-shape assertions inbind_keyed_lookup.133k orders, result cache off, same answers:
?o ex:placedBy ?c OPTIONAL { ?o ex:qty ?q FILTER(?q > 90) }?c ^ex:placedBy ?o OPTIONAL { ?o ex:qty ?q FILTER(?q > 90) }COUNT(?q)withOPTIONAL { … FILTER(?a > 4000 && ?q < 10) }cargo fmt --checkandcargo clippy -p tripletrail --all-targets -D warningspass.Documentation
docs/store.md: the id tables paragraph, which said a filteredOPTIONALis always evaluated as usual. It now says such a pattern is counted on ids, and under ids answered on ids.docs/server.md: the--executorlist.Docs checked:
--executor idssection (13-production.md) namesOPTIONALin general and stays true. The README has no list.docs/server.mdtouches the same line as #175. Whichever merges second needs a small merge, and I'll do it.