Wikidata:SPARQL query service/query limits
It would be good, as a community, to try to map out the limits of what is currently possible with the query service -- in particular, for example, how far it is possible to broaden narrow queries before they time out.
In some cases, there may then be ways to re-write the queries, or change their query optimization to allow broader queries to be run, pushing the limits further. (In particular, if query performance suddenly "falls off a cliff" as the query is run for broader groups, as per the example presented on the optimization page, this can be a sign that the built-in optimization strategy has changed, which can sometimes be overcome by specifying a hand-ordering for the query).
In other cases, searching for the limits may reveal strange performance issues, such as some of those listed in the performance surprises section of the suggestions page. But it would be good to get an idea, generally, of what is and what is not possible, with the current set-up
- See also Wikidata:SPARQL query service/queries/examples for examples of queries to test.
Items
[edit]Count distinct items
[edit]Items plus descriptions in one language
[edit]LANG and equality
[edit]langMatches
[edit]
1 tinyurl.com/y8sxdwgu
10^4 tinyurl.com/yc5224u8
Items with missing description in one language
[edit]First sub-query returns 1126436 results; working queries can timeout
arincorrect results, 1029767
rulikely correct results, 1113623
itlikely correct results, 820584
delikely correct results, 944371
Geographical queries
[edit]AROUND substitute
[edit]
Places in Scotland within 50 miles of Edinburgh Airport (count) tinyurl.com/p3vyzrx5661 places in 1.5 seconds
Places in the UK within 50 miles of Edinburgh Airport (count) tinyurl.com/ppw2alm(Query timeout limit reached (was: "Concurrent Modification Exception" 30407 places in 42 seconds / 30407 places in 17 seconds)
Places in the Netherlands within 50 miles of Schiphol Airport (count) tinyurl.com/ocmhcjv151251 places in 54 sec (was: "Concurrent Modification Exception")
Search within box
[edit]
Places within 1 degree lat/long of the Arc de Triomphe (count) tinyurl.com/nzvowpg17,931 places in 8.6 seconds
Places within 3 degrees lat/long of the Arc de Triomphe (count) tinyurl.com/ng53my3211991 in 58 seconds
Places within 4 degrees lat/long of the Arc de Triomphe (count) tinyurl.com/pfynsycQuery timeout
Places within 5 degrees lat/long of the Arc de Triomphe (count) tinyurl.com/oh86297"Concurrent Modification Exception" / Timeout
Bounding box
[edit]
Maximum lat and long for places in UK tinyurl.com/orjxbae165320 places in 22.7 seconds / 165320 in 11.7 seconds (As of 4/19/19 this query is timing out, but Denmark Q35 in place of Q145 yields 51,929 locations in 5.4 seconds.)
Maximum lat and long for places in USA tinyurl.com/qgrexwm227978 places in 17.8 seconds
Maximum lat and long for places in Netherlands tinyurl.com/qg95pz6315705 places in 21.5 seconds
Strange results
[edit]STRLEN
[edit]
# User_talk:Ivan_A._Krestinin#Edits_with_no_change
# 9 latin chars according to http://www.ccli.gov.hk/iicore/iicore.html
SELECT ?value
(STRLEN(?value) AS ?stringLength)
(STRLEN("XX3386112"^^xsd:string) AS ?goal)
WHERE
{
wd:Q3785162 wdt:P950 ?value
}