Let's ask the SPARQL optimization gurus 馃檪
We could also first make a simple fast query, then a second one to get second-importance info (labels, is the item ended, item class, grave items, etc)
Wikishootme's query is much faster than ours, but it grabs less data. We could start with a qury like theirs, then get details.
For ref this is our current query: http://tinyurl.com/yakxk726
I tried removing the emoji attribute from the query and the query became considerably faster ie from ~5200ms to ~2100ms.
New query: http://tinyurl.com/yaafoa5n
Compare it with the original query: http://tinyurl.com/yakxk726
AFAIK, we don't use emoji value.
Great finding! This will save me a lot of waiting time every day :-)
I have raised a PR removing icon and emoji. Both attributes were not being used by the app. The loading is much faster now. :)
I have a couple of more suggestions:
Observable from RxJava to emit results as they arrive. (Was asked by @VojtechDostal to make here a suggestion.)
https://www.mediawiki.org/wiki/Wikidata_Query_Service/User_Manual#SPARQL_endpoint states:
It is recommended to use GET for smaller queries and POST for larger queries, as POST queries are not cached.
The simplest way to bypass caching is to add some dummy string to the query, like a comment # and a random number.
Also those SERVICE wikibase:label calls in the query are redundant. They are known to make queries slow even if you make no use of them .
Most helpful comment
I tried removing the
emojiattribute from the query and the query became considerably faster ie from ~5200ms to ~2100ms.New query: http://tinyurl.com/yaafoa5n
Compare it with the original query: http://tinyurl.com/yakxk726
AFAIK, we don't use
emojivalue.