| Lucas_Werkmeister_WMDE created this task. Lucas_Werkmeister_WMDE added projects: Wikidata, Wikibase-Quality, Wikibase-Quality-Constraints, Wikidata-Query-Service. Herald added a subscriber: Aklapper. Herald added a project: Discovery. |
This query, without caching, takes about six seconds, sometimes up to eight:
ASK { wd:Q6012487 wdt:P31/wdt:P279* wd:Q386724. }With explicit gearing hint, it takes less than half a second:
ASK { wd:Q6012487 wdt:P31/wdt:P279* wd:Q386724. hint:Prior hint:gearing "forward". }This is the kind of query (does x have class y?) that we’ll run very often for WikibaseQualityConstraints type checks, so it would be great if it performed well without such optimizer hand-holding. (We also set the maxQueryTimeMillis URL parameter that BlazeGraph supports, so a long query runtime, even if below the default 60 s timeout, can result in false positives (constraint violations) for us.)
This query, on the other hand, which in a way inlines the start of the path (Q6012487 has only a single P31 statement), runs just as fast with and without gearing hint:
ASK { wd:Q571 wdt:P279* wd:Q386724. }I assume BlazeGraph chooses the forward hearing for this query by default, for whatever reason. (With explicit "reverse" gearing hint, it takes about as long as the original query without hint.)
And finally, just to paint the full picture, the query we actually use in WikibaseQualityConstraints for type checking is this:
ASK { BIND(wd:Q6012487 AS ?item) VALUES ?class { wd:Q386724 } ?item wdt:P31/wdt:P279* ?class. }since there can be multiple permitted classes. This currently behaves just like the original query both with and without gearing hint, but it would be unfortunate if the fix for this bug only affected the first query but not the one we actually use :)
Cc: Aklapper, Smalyshev, Lucas_Werkmeister_WMDE, GoranSMilovanovic, QZanden, EBjune, merbst, Avner, debt, Gehel, Jonas, FloNight, Xmlizer, Izno, jkroll, Wikidata-bugs, Jdouglas, aude, Tobias1984, Manybubbles, Mbch331
_______________________________________________ Wikidata-bugs mailing list [email protected] https://lists.wikimedia.org/mailman/listinfo/wikidata-bugs
