Page MenuHomePhabricator

GROUP, OPTIONAL and LABEL service leads to timeout
Closed, ResolvedPublic

Description

Somehow the below times-out once OPTIONAL {} is added:

SELECT 	
	?item ?itemLabel
	(GROUP_CONCAT(DISTINCT ?instanceLabel; separator=", ") as ?i)
	(SAMPLE(?metricalPattern) as ?mp)
WHERE 
{
	?item wdt:P31/wdt:P279* wd:Q1651051 .
	?item wdt:P31 ?instance . 
	OPTIONAL { ?item wdt:P2552 ?metricalPattern }.
	SERVICE wikibase:label { bd:serviceParam wikibase:language "it,en" . ?instance rdfs:label ?instanceLabel . ?item rdfs:label ?itemLabel }
}
GROUP BY ?item ?itemLabel

try it. Without optional: try it

More complex queries work (see here). The main difference seems to be the concat on labels.

How can this be improved?

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript
Esc3300 updated the task description. (Show Details)
Esc3300 updated the task description. (Show Details)

Change 315892 had a related patch set uploaded (by Smalyshev):
Add workaround for Blazegraph optimizer bug with labels explicitly specified.

https://gerrit.wikimedia.org/r/315892

Change 315892 merged by jenkins-bot:
Add workaround for Blazegraph optimizer bug with labels explicitly specified.

https://gerrit.wikimedia.org/r/315892

Smalyshev claimed this task.